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

Commit 205307ea authored by Chen Bai's avatar Chen Bai Committed by Android Build Coastguard Worker
Browse files

keyGesture: fix crown press going to WF for ambientlite & keyguard

When ambient-lite is shown and keyguard is set, the crown press should
not go back to WF after unlock. It should unlock on the the amibent
lite screen and the app that was on top.

Bug: 447211252
Flag: EXEMPT BUGFIX
Test: manual
(cherry picked from commit 4ffa541b96d6a828a8a72db80ab8030fec5e00c6)
Cherrypick-From: https://googleplex-android-review.googlesource.com/q/commit:451c1aebc27a8e85685265293ee39b6371baacbe
Merged-In: I6a6d877b798ed12602b23a2c9df788172ae6b4ee
Change-Id: I6a6d877b798ed12602b23a2c9df788172ae6b4ee
parent 23b2ba67
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -1372,8 +1372,15 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    }

    private void shortPressPowerGoHome() {
        launchHomeFromHotKey(DEFAULT_DISPLAY, true /* awakenFromDreams */,
                false /*respectKeyguard*/);
        KeyGestureEvent keyGestureEvent =
                new KeyGestureEvent.Builder()
                        .setKeyGestureType(KeyGestureEvent.KEY_GESTURE_TYPE_HOME)
                        .setAction(KeyGestureEvent.ACTION_GESTURE_COMPLETE)
                        .setDisplayId(mDefaultDisplay.getDisplayId())
                        .setKeycodes(new int[] {KEYCODE_POWER})
                        .setModifierState(/* metaState= */ 0)
                        .build();
        mInputManagerInternal.handleKeyGestureInKeyGestureController(keyGestureEvent);
        if (isKeyguardShowingAndNotOccluded()) {
            // Notify keyguard so it can do any special handling for the power button since the
            // device will not power off and only launch home.