@@ -175,7 +175,7 @@ public class KeyguardViewMediator {
175175 * Does not turn on screen, held while a call to {@link KeyguardViewManager#wakeWhenReadyTq(int)}
176176 * is called to make sure the device doesn't sleep before it has a chance to poke
177177 * the wake lock.
178- * @see #wakeWhenReadyLocked (int)
178+ * @see #wakeWhenReady (int)
179179 */
180180 private PowerManager .WakeLock mWakeAndHandOff ;
181181
@@ -935,8 +935,8 @@ private void notifyScreenOnLocked(KeyguardViewManager.ShowListener showListener)
935935 * @see #handleWakeWhenReady
936936 * @see #onWakeKeyWhenKeyguardShowingTq(int)
937937 */
938- private void wakeWhenReadyLocked (int keyCode ) {
939- if (DBG_WAKE ) Log .d (TAG , "wakeWhenReadyLocked (" + keyCode + ")" );
938+ private void wakeWhenReady (int keyCode ) {
939+ if (DBG_WAKE ) Log .d (TAG , "wakeWhenReady (" + keyCode + ")" );
940940
941941 /**
942942 * acquire the handoff lock that will keep the cpu running. this will
@@ -1014,54 +1014,14 @@ public void onReceive(Context context, Intent intent) {
10141014 * action should be posted to a handler.
10151015 *
10161016 * @param keyCode The keycode of the key that woke the device
1017- * @param isDocked True if the device is in the dock
1018- * @return Whether we poked the wake lock (and turned the screen on)
10191017 */
1020- public boolean onWakeKeyWhenKeyguardShowingTq (int keyCode , boolean isDocked ) {
1018+ public void onWakeKeyWhenKeyguardShowingTq (int keyCode ) {
10211019 if (DEBUG ) Log .d (TAG , "onWakeKeyWhenKeyguardShowing(" + keyCode + ")" );
10221020
1023- if (isWakeKeyWhenKeyguardShowing (keyCode , isDocked )) {
1024- // give the keyguard view manager a chance to adjust the state of the
1025- // keyguard based on the key that woke the device before poking
1026- // the wake lock
1027- wakeWhenReadyLocked (keyCode );
1028- return true ;
1029- } else {
1030- return false ;
1031- }
1032- }
1033-
1034- /**
1035- * When the keyguard is showing we ignore some keys that might otherwise typically
1036- * be considered wake keys. We filter them out here.
1037- *
1038- * {@link KeyEvent#KEYCODE_POWER} is notably absent from this list because it
1039- * is always considered a wake key.
1040- */
1041- private boolean isWakeKeyWhenKeyguardShowing (int keyCode , boolean isDocked ) {
1042- switch (keyCode ) {
1043- // ignore volume keys unless docked
1044- case KeyEvent .KEYCODE_VOLUME_UP :
1045- case KeyEvent .KEYCODE_VOLUME_DOWN :
1046- case KeyEvent .KEYCODE_VOLUME_MUTE :
1047- return isDocked ;
1048-
1049- // ignore media and camera keys
1050- case KeyEvent .KEYCODE_MUTE :
1051- case KeyEvent .KEYCODE_HEADSETHOOK :
1052- case KeyEvent .KEYCODE_MEDIA_PLAY :
1053- case KeyEvent .KEYCODE_MEDIA_PAUSE :
1054- case KeyEvent .KEYCODE_MEDIA_PLAY_PAUSE :
1055- case KeyEvent .KEYCODE_MEDIA_STOP :
1056- case KeyEvent .KEYCODE_MEDIA_NEXT :
1057- case KeyEvent .KEYCODE_MEDIA_PREVIOUS :
1058- case KeyEvent .KEYCODE_MEDIA_REWIND :
1059- case KeyEvent .KEYCODE_MEDIA_RECORD :
1060- case KeyEvent .KEYCODE_MEDIA_FAST_FORWARD :
1061- case KeyEvent .KEYCODE_CAMERA :
1062- return false ;
1063- }
1064- return true ;
1021+ // give the keyguard view manager a chance to adjust the state of the
1022+ // keyguard based on the key that woke the device before poking
1023+ // the wake lock
1024+ wakeWhenReady (keyCode );
10651025 }
10661026
10671027 /**
@@ -1073,17 +1033,14 @@ private boolean isWakeKeyWhenKeyguardShowing(int keyCode, boolean isDocked) {
10731033 * The 'Tq' suffix is per the documentation in {@link WindowManagerPolicy}.
10741034 * Be sure not to take any action that takes a long time; any significant
10751035 * action should be posted to a handler.
1076- *
1077- * @return Whether we poked the wake lock (and turned the screen on)
10781036 */
1079- public boolean onWakeMotionWhenKeyguardShowingTq () {
1037+ public void onWakeMotionWhenKeyguardShowingTq () {
10801038 if (DEBUG ) Log .d (TAG , "onWakeMotionWhenKeyguardShowing()" );
10811039
10821040 // give the keyguard view manager a chance to adjust the state of the
10831041 // keyguard based on the key that woke the device before poking
10841042 // the wake lock
1085- wakeWhenReadyLocked (KeyEvent .KEYCODE_UNKNOWN );
1086- return true ;
1043+ wakeWhenReady (KeyEvent .KEYCODE_UNKNOWN );
10871044 }
10881045
10891046 public void keyguardDone (boolean authenticated , boolean wakeup ) {
@@ -1350,7 +1307,7 @@ private void adjustStatusBarLocked() {
13501307 }
13511308
13521309 /**
1353- * Handle message sent by {@link #wakeWhenReadyLocked (int)}
1310+ * Handle message sent by {@link #wakeWhenReady (int)}
13541311 * @param keyCode The key that woke the device.
13551312 * @see #WAKE_WHEN_READY
13561313 */
0 commit comments