diff options
| author | Steven Ross <stross@google.com> | 2012-09-27 11:29:37 -0400 |
|---|---|---|
| committer | Steven Ross <stross@google.com> | 2012-09-27 13:23:16 -0400 |
| commit | acbe41fc1316cf16f03de80c84ea311cc4f55ffb (patch) | |
| tree | 2f3e2c7d7924f12eef36dcbc1feb5473dae27907 /policy | |
| parent | 9a4a0376a78f9b3bcfe6374660fbe7c28797b36a (diff) | |
| download | frameworks_base-acbe41fc1316cf16f03de80c84ea311cc4f55ffb.zip frameworks_base-acbe41fc1316cf16f03de80c84ea311cc4f55ffb.tar.gz frameworks_base-acbe41fc1316cf16f03de80c84ea311cc4f55ffb.tar.bz2 | |
Only poke the wakelock for FUL if the screen is on fixes 7222901
Change-Id: Ie00084fcaef3127ac917c740e5eea3fce463cbcd
Diffstat (limited to 'policy')
| -rw-r--r-- | policy/src/com/android/internal/policy/impl/keyguard/FaceUnlock.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/FaceUnlock.java b/policy/src/com/android/internal/policy/impl/keyguard/FaceUnlock.java index a4159d0..4f2f6bf 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/FaceUnlock.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/FaceUnlock.java @@ -29,6 +29,7 @@ import android.os.Handler; import android.os.IBinder; import android.os.Looper; import android.os.Message; +import android.os.PowerManager; import android.os.RemoteException; import android.util.Log; import android.view.View; @@ -128,6 +129,8 @@ public class FaceUnlock implements BiometricSensorUnlock, Handler.Callback { */ public void hide() { if (DEBUG) Log.d(TAG, "hide()"); + // Removes any wakelock messages to make sure they don't cause the screen to turn back on. + mHandler.removeMessages(MSG_POKE_WAKELOCK); // Remove messages to prevent a delayed show message from undo-ing the hide removeDisplayMessages(); mHandler.sendEmptyMessage(MSG_HIDE_FACE_UNLOCK_VIEW); @@ -384,10 +387,14 @@ public class FaceUnlock implements BiometricSensorUnlock, Handler.Callback { } /** - * Pokes the wakelock to keep the screen alive and active for a specific amount of time. + * If the screen is on, pokes the wakelock to keep the screen alive and active for a specific + * amount of time. */ void handlePokeWakelock(int millis) { + PowerManager powerManager = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE); + if (powerManager.isScreenOn()) { mKeyguardScreenCallback.userActivity(millis); + } } /** |
