Skip to content

Commit

Permalink
Lockscreen : Fix vol wake for lockscreen security type none
Browse files Browse the repository at this point in the history
Modified the logic so that when lockscreen type is set to none,
it doesnt always wake up the device.

Change-Id: I64d970a9f3c89b50c781c0046bcf21fb382a298a
  • Loading branch information
Danesh committed Mar 16, 2012
1 parent 9355686 commit 5b87189
Showing 1 changed file with 6 additions and 4 deletions.
Expand Up @@ -2856,16 +2856,15 @@ public int interceptKeyBeforeQueueing(KeyEvent event, int policyFlags, boolean i
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;
}
Expand Down Expand Up @@ -2992,6 +2991,9 @@ public int interceptKeyBeforeQueueing(KeyEvent event, int policyFlags, boolean i
keyCode = KeyEvent.KEYCODE_POWER;
mKeyguardMediator.onWakeKeyWhenKeyguardShowingTq(keyCode,
mDockMode != Intent.EXTRA_DOCK_STATE_UNDOCKED);
} else {
result |= ACTION_POKE_USER_ACTIVITY;
break;
}
}

Expand Down

0 comments on commit 5b87189

Please sign in to comment.