Skip to content

Commit 9eeaaa3

Browse files
author
Brian Colonna
committed
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
1 parent ab9d5b1 commit 9eeaaa3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler
126126
// The service can take a couple of seconds to start on the first try after boot
127127
private final int FACELOCK_VIEW_AREA_SERVICE_TIMEOUT = 3000;
128128

129+
// So the user has a consistent amount of time when brought to the backup method from FaceLock
130+
private final int BACKUP_LOCK_TIMEOUT = 5000;
131+
129132
/**
130133
* The current {@link KeyguardScreen} will use this to communicate back to us.
131134
*/
@@ -587,6 +590,10 @@ public void show() {
587590

588591
if (mLockPatternUtils.usingBiometricWeak() &&
589592
mLockPatternUtils.isBiometricWeakInstalled()) {
593+
// Note that show() gets called before the screen turns off to set it up for next time
594+
// it is turned on. We don't want to set a timeout on the FaceLock area here because it
595+
// may be gone by the time the screen is turned on again. We set the timout when the
596+
// screen turns on instead.
590597
showFaceLockArea();
591598
} else {
592599
hideFaceLockArea();
@@ -1250,6 +1257,7 @@ public void cancel() {
12501257
if (DEBUG) Log.d(TAG, "FaceLock cancel()");
12511258
hideFaceLockArea(); // Expose fallback
12521259
stopFaceLock();
1260+
mKeyguardScreenCallback.pokeWakelock(BACKUP_LOCK_TIMEOUT);
12531261
}
12541262

12551263
// Allows the Face Unlock service to poke the wake lock to keep the lockscreen alive

0 commit comments

Comments
 (0)