From 6a0634dcfee68ad0f13288c9c88b14d40600709f Mon Sep 17 00:00:00 2001 From: Curtis Belmonte Date: Mon, 19 Aug 2019 13:13:01 -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: Icecd7cb76688cd19f7e3b445a8228b21e1599068 --- .../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 de20972347d5b..8c5374a2a3fed 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java @@ -1446,6 +1446,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { protected void handleStartedGoingToSleep(int arg1) { checkIsHandlerThread(); + mLockIconPressed = false; clearBiometricRecognized(); for (int i = 0; i < mCallbacks.size(); i++) { KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get(); @@ -1481,7 +1482,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { private void handleScreenTurnedOff() { checkIsHandlerThread(); - mLockIconPressed = false; mHardwareFingerprintUnavailableRetryCount = 0; mHardwareFaceUnavailableRetryCount = 0; for (int i = 0; i < mCallbacks.size(); i++) {