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

Commit d914330c authored by Arthur Hung's avatar Arthur Hung Committed by Android (Google) Code Review
Browse files

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

parents 7d27c36d 615d01b6
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 {