When the system is shutting down or the screen is going to be off, <Standby>
message will be broadcasted if and only if the setting variable,
Settings.Global#HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED, is enabled. This change
will make the shutdown case to be checked with the setting properly, too.
Bug:
27781559
Change-Id: Ia6605d6b5627ab1ff67285d72846b618a09548bc
@ServiceThreadOnly
protected void onStandby(boolean initiatedByCec, int standbyAction) {
assertRunOnServiceThread();
- if (!mService.isControlEnabled() || initiatedByCec) {
+ if (!mService.isControlEnabled() || initiatedByCec || !mAutoTvOff) {
return;
}
switch (standbyAction) {
case HdmiControlService.STANDBY_SCREEN_OFF:
- if (mAutoTvOff) {
- mService.sendCecCommand(
- HdmiCecMessageBuilder.buildStandby(mAddress, Constants.ADDR_TV));
- }
+ mService.sendCecCommand(
+ HdmiCecMessageBuilder.buildStandby(mAddress, Constants.ADDR_TV));
break;
case HdmiControlService.STANDBY_SHUTDOWN:
// ACTION_SHUTDOWN is taken as a signal to power off all the devices.