CEC: Revive a standby handler
When a device is going into standby state, every CEC message is supposed to be handled by HdmiCecStandbyModeHandler. But the messages were blocked by address allocation check and just buffered. This change revives the standby handler so that the device can handle messages properly during standby mode. Bug: 30184027, Bug: 31873357, Bug: 33095971 Test: One touch play with chromecast works well during standby mode Change-Id: I3315fdaee346838c6a2c68bad0ac64b94ab9723c
This commit is contained in:
@@ -250,7 +250,8 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
|
||||
@ServiceThreadOnly
|
||||
boolean dispatchMessage(HdmiCecMessage message) {
|
||||
assertRunOnServiceThread();
|
||||
if (mService.isPowerStandby() && mStandbyHandler.handleCommand(message)) {
|
||||
if (mService.isPowerStandby() && !mService.isWakeUpMessageReceived()
|
||||
&& mStandbyHandler.handleCommand(message)) {
|
||||
return true;
|
||||
}
|
||||
return super.onMessage(message);
|
||||
|
||||
@@ -2014,6 +2014,10 @@ public final class HdmiControlService extends SystemService {
|
||||
// the intent, the sequence will continue at onStandby().
|
||||
}
|
||||
|
||||
boolean isWakeUpMessageReceived() {
|
||||
return mWakeUpMessageReceived;
|
||||
}
|
||||
|
||||
@ServiceThreadOnly
|
||||
private void onWakeUp() {
|
||||
assertRunOnServiceThread();
|
||||
@@ -2116,7 +2120,6 @@ public final class HdmiControlService extends SystemService {
|
||||
device.onStandby(mStandbyMessageReceived, standbyAction);
|
||||
}
|
||||
mStandbyMessageReceived = false;
|
||||
mAddressAllocated = false;
|
||||
mCecController.setOption(OptionKey.SYSTEM_CEC_CONTROL, false);
|
||||
mMhlController.setOption(OPTION_MHL_SERVICE_CONTROL, DISABLED);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user