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

Commit a82d1f6a authored by Nathalie Le Clair's avatar Nathalie Le Clair Committed by Aaron Kling
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 1d729785
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -5264,12 +5264,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,
@@ -5294,6 +5288,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        } else {
            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;
    }