From 9eeaaa39c3bad72a369aeff11f95ffea13a5e214 Mon Sep 17 00:00:00 2001 From: Brian Colonna Date: Thu, 13 Oct 2011 20:11:57 -0400 Subject: [PATCH] Fix 5451144: Poking wakelock upon fallback Now poking the wakelock when Face Unlock goes to the fallback method. Previously, the backup lock would stay up for a varying amount of time depending on how long Face Unlock took before fallback. The backup is now consistently displayed for 5 seconds. Also added comments to some older code. Change-Id: I9f6bdd2d3015e7eb9cb90143737a3cdc87189993 --- .../internal/policy/impl/LockPatternKeyguardView.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java b/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java index 0c44e45884d7b..eead405da7acf 100644 --- a/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java +++ b/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java @@ -126,6 +126,9 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler // The service can take a couple of seconds to start on the first try after boot private final int FACELOCK_VIEW_AREA_SERVICE_TIMEOUT = 3000; + // So the user has a consistent amount of time when brought to the backup method from FaceLock + private final int BACKUP_LOCK_TIMEOUT = 5000; + /** * The current {@link KeyguardScreen} will use this to communicate back to us. */ @@ -587,6 +590,10 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler if (mLockPatternUtils.usingBiometricWeak() && mLockPatternUtils.isBiometricWeakInstalled()) { + // Note that show() gets called before the screen turns off to set it up for next time + // it is turned on. We don't want to set a timeout on the FaceLock area here because it + // may be gone by the time the screen is turned on again. We set the timout when the + // screen turns on instead. showFaceLockArea(); } else { hideFaceLockArea(); @@ -1250,6 +1257,7 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler if (DEBUG) Log.d(TAG, "FaceLock cancel()"); hideFaceLockArea(); // Expose fallback stopFaceLock(); + mKeyguardScreenCallback.pokeWakelock(BACKUP_LOCK_TIMEOUT); } // Allows the Face Unlock service to poke the wake lock to keep the lockscreen alive