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

Commit 5b871892 authored by Danesh Mondegarian's avatar Danesh Mondegarian
Browse files

Lockscreen : Fix vol wake for lockscreen security type none

Modified the logic so that when lockscreen type is set to none,
it doesnt always wake up the device.

Change-Id: I64d970a9f3c89b50c781c0046bcf21fb382a298a
parent 9355686e
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -2856,16 +2856,15 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            result = 0;

            final boolean isWakeKey = (policyFlags
                    & (WindowManagerPolicy.FLAG_WAKE | WindowManagerPolicy.FLAG_WAKE_DROPPED)) != 0
                    || (((keyCode == KeyEvent.KEYCODE_VOLUME_UP) || (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN))
                            && mVolumeWakeScreen && !isScreenOn);
                    & (WindowManagerPolicy.FLAG_WAKE | WindowManagerPolicy.FLAG_WAKE_DROPPED)) != 0;


            if (down && isWakeKey) {
                if (keyguardActive) {
                    // If the keyguard is showing, let it decide what to do with the wake key.
                    mKeyguardMediator.onWakeKeyWhenKeyguardShowingTq(keyCode,
                            mDockMode != Intent.EXTRA_DOCK_STATE_UNDOCKED);
                } else {
                } else if ((keyCode != KeyEvent.KEYCODE_VOLUME_UP) && (keyCode != KeyEvent.KEYCODE_VOLUME_DOWN)) {
                    // Otherwise, wake the device ourselves.
                    result |= ACTION_POKE_USER_ACTIVITY;
                }
@@ -2992,6 +2991,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                    keyCode = KeyEvent.KEYCODE_POWER;
                    mKeyguardMediator.onWakeKeyWhenKeyguardShowingTq(keyCode,
                            mDockMode != Intent.EXTRA_DOCK_STATE_UNDOCKED);
                } else {
                    result |= ACTION_POKE_USER_ACTIVITY;
                    break;
                }
            }