Add a hack that ensures face auth failed message is not shown after face lockout

Bug: 270090188
Test: atest KeyguardUpdateMonitorTest
Test: manually,
  1. enroll a friend's face for auth
  2. Lock the phone
  3. Try face auth 3 times
  4. on the first lockout, we should see too many attempts
  5. after that, we should see face unlock unavailable.
Change-Id: I1354f5f6159fb371313ecac3905c545e2af6a62d
This commit is contained in:
Chandru S
2023-05-11 20:15:10 -07:00
parent f9be53278f
commit 72808e6439

View File

@@ -1460,6 +1460,14 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
ErrorAuthenticationStatus error = (ErrorAuthenticationStatus) status;
handleFaceError(error.getMsgId(), error.getMsg());
} else if (status instanceof FailedAuthenticationStatus) {
if (isFaceLockedOut()) {
// TODO b/270090188: remove this hack when biometrics fixes this issue.
// FailedAuthenticationStatus is emitted after ErrorAuthenticationStatus
// for lockout error is received
mLogger.d("onAuthenticationFailed called after"
+ " face has been locked out");
return;
}
handleFaceAuthFailed();
} else if (status instanceof HelpAuthenticationStatus) {
HelpAuthenticationStatus helpMsg = (HelpAuthenticationStatus) status;
@@ -1968,6 +1976,13 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
@Override
public void onAuthenticationFailed() {
if (isFaceLockedOut()) {
// TODO b/270090188: remove this hack when biometrics fixes this issue.
// onAuthenticationFailed is called after onAuthenticationError
// for lockout error is received
mLogger.d("onAuthenticationFailed called after face has been locked out");
return;
}
handleFaceAuthFailed();
}