Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit afd26a25 authored by Donghyun Cho's avatar Donghyun Cho
Browse files

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
parent 10657346
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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);
+4 −1
Original line number Diff line number Diff line
@@ -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);
    }