From b46f97157356ab27224e70cd8184f2d5cfb24721 Mon Sep 17 00:00:00 2001 From: Curtis Belmonte Date: Mon, 20 Jul 2020 17:22:06 -0700 Subject: [PATCH] Don't auto-restart face auth after successful auth Currently, face auth sends a message to restart face authentication 500ms after a successful authentication attempt. This is a holdover from fingerprint and is unnecessary for face, since the latter is entirely interrupt-driven. It is also leading to issues where face auth will scan repeatedly when SystemUI freezes or is slow to respond. Thus, this commit removes the restart behavior after the user has authenticated. Test: atest com.android.keyguard Test: Manually verified face auth functionality in Keyguard. Bug: 157630051 Change-Id: I8bfb7870d3c68f6d40fdbf7209446782c5805f8f --- .../com/android/keyguard/KeyguardUpdateMonitor.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java index c07c982b74514..60541eb56afcb 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java @@ -286,11 +286,11 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab private final Executor mBackgroundExecutor; /** - * Short delay before restarting biometric authentication after a successful try - * This should be slightly longer than the time between onAuthenticated - * (e.g. onFingerprintAuthenticated) and setKeyguardGoingAway(true). + * Short delay before restarting fingerprint authentication after a successful try. This should + * be slightly longer than the time between onFingerprintAuthenticated and + * setKeyguardGoingAway(true). */ - private static final int BIOMETRIC_CONTINUE_DELAY_MS = 500; + private static final int FINGERPRINT_CONTINUE_DELAY_MS = 500; // If the HAL dies or is unable to authenticate, keyguard should retry after a short delay private int mHardwareFingerprintUnavailableRetryCount = 0; @@ -598,7 +598,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab } mHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_BIOMETRIC_AUTHENTICATION_CONTINUE), - BIOMETRIC_CONTINUE_DELAY_MS); + FINGERPRINT_CONTINUE_DELAY_MS); // Only authenticate fingerprint once when assistant is visible mAssistantVisible = false; @@ -780,9 +780,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab } } - mHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_BIOMETRIC_AUTHENTICATION_CONTINUE), - BIOMETRIC_CONTINUE_DELAY_MS); - // Only authenticate face once when assistant is visible mAssistantVisible = false;