From 15114abda24f667c5568f63ed96cebddee8efba2 Mon Sep 17 00:00:00 2001 From: Curtis Belmonte Date: Fri, 16 Aug 2019 14:32:14 -0700 Subject: [PATCH] Fix face auth not triggering after lock icon pressed Long-pressing on the lock icon after the device has been unlocked causes it to relock until the user manually authenticates. This intentionally disables face unlock, since we don't want the device to unlock again immediately after the lock icon has been pressed. However, when the device screen turns off, pressing the power button again should re-trigger face auth. This commit fixes a bug in that flow where, if a user long presses the lock icon, then turns the screen off and back on very quickly, face auth is not retriggered. It does this by resetting the lock icon pressed status when the device begins going to sleep, rather than when the screen has been fully turned off. Test: manual 1. Enroll face and turn off "skip lock screen" 2. Lock device, then wake and unlock with face 3. Long-press on the lock icon to relock device 4. Enter PIN/pattern/password to unlock the device 5. Press power twice in quick succession (without triggering camera) Before: Lock screen would be shown but face auth would not trigger After: Lock screen is shown and face auth is triggered Fixes: 138974321 Change-Id: I7d6a8c2b9cc95d3003f006a403866796dab67e82 Merged-In: Icecd7cb76688cd19f7e3b445a8228b21e1599068 --- packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java index 72ad99378eb0..c5847a8a7e31 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java @@ -1403,6 +1403,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { } protected void handleStartedGoingToSleep(int arg1) { + mLockIconPressed = false; clearBiometricRecognized(); final int count = mCallbacks.size(); for (int i = 0; i < count; i++) { @@ -1438,7 +1439,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { } private void handleScreenTurnedOff() { - mLockIconPressed = false; mHardwareFingerprintUnavailableRetryCount = 0; mHardwareFaceUnavailableRetryCount = 0; final int count = mCallbacks.size(); -- 2.11.0