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

Commit 2f67e870 authored by Arthur Hung's avatar Arthur Hung Committed by Automerger Merge Worker
Browse files

Merge "Power button press behavior should account for default display state"...

Merge "Power button press behavior should account for default display state" into sc-dev am: d914330c

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14134526

Change-Id: I5b82d0cafc58b75ff0f8d76e0460acce1ce9b873
parents 320ed578 d914330c
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -3409,8 +3409,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            return interceptKeyBeforeQueueing(event, policyFlags);
        }

        // This could prevent some wrong state in multi-displays environment,
        // the default display may turned off but interactive is true.
        final boolean isDefaultDisplayOn = Display.isOnState(mDefaultDisplay.getState());
        final boolean interactiveAndOn = interactive && isDefaultDisplayOn;
        if ((event.getFlags() & KeyEvent.FLAG_FALLBACK) == 0) {
            handleKeyGesture(event, interactive);
            handleKeyGesture(event, interactiveAndOn);
        }

        // Enable haptics if down and virtual key without multiple repetitions. If this is a hard
@@ -3557,8 +3561,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                // Any activity on the power button stops the accessibility shortcut
                result &= ~ACTION_PASS_TO_USER;
                isWakeKey = false; // wake-up will be handled separately
                final boolean isDefaultDisplayOn = Display.isOnState(mDefaultDisplay.getState());
                final boolean interactiveAndOn = interactive && isDefaultDisplayOn;
                if (down) {
                    interceptPowerKeyDown(event, interactiveAndOn);
                } else {