From 3e22b1d62ac347e8916f348e052752cbd9e8e63c Mon Sep 17 00:00:00 2001 From: Joe Bolinger Date: Fri, 23 Jul 2021 16:59:08 -0700 Subject: [PATCH] Prevent fingerprint icon from showing when unlocking while fingerprint is in lockout. Fix: 194017474 Test: manual (lockout fingerprint and unlock with PIN) Change-Id: If25cc655687b215f6ad68acf67f1dc60e6715785 --- .../android/keyguard/KeyguardUpdateMonitor.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java index 9a9e4a9109923..23d6ebc46030f 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java @@ -149,7 +149,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab private static final boolean DEBUG_SIM_STATES = KeyguardConstants.DEBUG_SIM_STATES; private static final boolean DEBUG_FACE = Build.IS_DEBUGGABLE; private static final boolean DEBUG_SPEW = false; - private static final int LOW_BATTERY_THRESHOLD = 20; + private static final int FINGERPRINT_LOCKOUT_RESET_DELAY_MS = 600; private static final String ACTION_FACE_UNLOCK_STARTED = "com.android.facelock.FACE_UNLOCK_STARTED"; @@ -834,7 +834,18 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab private void handleFingerprintLockoutReset() { mFingerprintLockedOut = false; mFingerprintLockedOutPermanent = false; - updateFingerprintListeningState(); + + if (isUdfpsEnrolled()) { + // TODO(b/194825098): update the reset signal(s) + // A successful unlock will trigger a lockout reset, but there is no guarantee + // that the events will arrive in a particular order. Add a delay here in case + // an unlock is in progress. In this is a normal unlock the extra delay won't + // be noticeable. + mHandler.postDelayed(this::updateFingerprintListeningState, + FINGERPRINT_LOCKOUT_RESET_DELAY_MS); + } else { + updateFingerprintListeningState(); + } } private void setFingerprintRunningState(int fingerprintRunningState) {