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

Commit fc01f04a authored by Michael Wright's avatar Michael Wright
Browse files

Allow wake keys to wake dozing device.

The new key interception policy removed the wake status from key
presses while in the device was dozing.  Since we still want to wake
from these keys by going from doze -> fully interactive, just don't
remove the wake status and allow the device to be woken up as normal.

Bug: 17422475
Change-Id: I835e51cc9c557d8ce2e8f8502d84f04aae138e79
parent d87f2107
Loading
Loading
Loading
Loading
+9 −6
Original line number Original line Diff line number Diff line
@@ -4240,14 +4240,17 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        int result;
        int result;
        boolean isWakeKey = (policyFlags & WindowManagerPolicy.FLAG_WAKE) != 0
        boolean isWakeKey = (policyFlags & WindowManagerPolicy.FLAG_WAKE) != 0
                || event.isWakeKey();
                || event.isWakeKey();
        if (interactive
        if (interactive || (isInjected && !isWakeKey)) {
                || (isInjected && !isWakeKey)
            // When the device is interactive or the key is injected pass the key to the
                || (!interactive && shouldDispatchInputWhenNonInteractive())) {
            // application.
            // When the device is interactive, the key is injected, or we're currently dozing in a
            // non-interactive state with the screen on and the keyguard showing,  pass the key to
            // the application.
            result = ACTION_PASS_TO_USER;
            result = ACTION_PASS_TO_USER;
            isWakeKey = false;
            isWakeKey = false;
        } else if (!interactive && shouldDispatchInputWhenNonInteractive()) {
            // If we're currently dozing with the screen on and the keyguard showing, pass the key
            // to the application but preserve its wake key status to make sure we still move
            // from dozing to fully interactive if we would normally go from off to fully
            // interactive.
            result = ACTION_PASS_TO_USER;
        } else {
        } else {
            // When the screen is off and the key is not injected, determine whether
            // When the screen is off and the key is not injected, determine whether
            // to wake the device but don't pass the key to the application.
            // to wake the device but don't pass the key to the application.