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

Commit bd3deee3 authored by Jinsuk Kim's avatar Jinsuk Kim
Browse files

CEC: Explicitly turn on screen for remote control passthrough

Ensures that the playback device turns on display output signal
upon receiving CEC command <User Control Pressed>.

Bug: 19518981
Change-Id: I4f898380c9ffc071da2357a51e61309ae5d233f5
(cherry picked from commit 9b8507c5)
parent 0afd1905
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -179,6 +179,13 @@ final class HdmiCecLocalDevicePlayback extends HdmiCecLocalDevice {
        }
    }

    @ServiceThreadOnly
    protected boolean handleUserControlPressed(HdmiCecMessage message) {
        assertRunOnServiceThread();
        wakeUpIfActiveSource();
        return super.handleUserControlPressed(message);
    }

    @Override
    @ServiceThreadOnly
    protected boolean handleSetStreamPath(HdmiCecMessage message) {
@@ -216,7 +223,12 @@ final class HdmiCecLocalDevicePlayback extends HdmiCecLocalDevice {
    }

    private void wakeUpIfActiveSource() {
        if (mIsActiveSource && mService.isPowerStandbyOrTransient()) {
        if (!mIsActiveSource) {
            return;
        }
        // Wake up the device if the power is in standby mode, or its screen is off -
        // which can happen if the device is holding a partial lock.
        if (mService.isPowerStandbyOrTransient() || !mService.getPowerManager().isScreenOn()) {
            mService.wakeUp();
        }
    }