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

Commit 668cbc96 authored by Nathalie Le Clair's avatar Nathalie Le Clair
Browse files

Invoke One Touch Play on wakeUp for HDMI playback devices

Change: Move OTP call from wakeUpFromPowerKey to wakeUp
Result: On any HDMI playback device wake-up, the connected HDMI sink
will turn on and display content

Test: make, flash, home button key press on remote control results in
OTP

Bug: 151065016
Change-Id: I54e97deb4dee3a60c2725ec3b58aa89179ecbca2
parent cb83004e
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -4468,12 +4468,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    private void wakeUpFromPowerKey(long eventTime) {
        wakeUp(eventTime, mAllowTheaterModeWakeFromPowerKey,
                PowerManager.WAKE_REASON_POWER_BUTTON, "android.policy:POWER");

        // Turn on the connected TV and switch HDMI input if we're a HDMI playback device.
        final HdmiControl hdmiControl = getHdmiControl();
        if (hdmiControl != null) {
            hdmiControl.turnOnTv();
        }
    }

    private boolean wakeUp(long wakeTime, boolean wakeInTheaterMode, @WakeReason int reason,
@@ -4489,6 +4483,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        }

        mPowerManager.wakeUp(wakeTime, reason, details);

        // Turn on the connected TV and switch HDMI input if we're a HDMI playback device.
        final HdmiControl hdmiControl = getHdmiControl();
        if (hdmiControl != null) {
            hdmiControl.turnOnTv();
        }
        return true;
    }