14/n: Animate to device credential UI when lockout occurs
Test: manual test with BiometricPromptDemo
Test: atest com.android.systemui.biometrics
Test: atest BiometricServiceTest
Change-Id: I83547c28f1b164dc772b01861430f0d479e47a75
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java b/packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java
index 1e8c26d..74e170d 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java
@@ -23,6 +23,7 @@
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
+import android.hardware.biometrics.BiometricConstants;
import android.hardware.biometrics.BiometricPrompt;
import android.hardware.biometrics.IBiometricServiceReceiverInternal;
import android.os.Bundle;
@@ -242,9 +243,16 @@
}
@Override
- public void onBiometricError(String error) {
- if (DEBUG) Log.d(TAG, "onBiometricError: " + error);
- mCurrentDialog.onError(error);
+ public void onBiometricError(int errorCode, String error) {
+ if (DEBUG) Log.d(TAG, "onBiometricError: " + errorCode + ", " + error);
+
+ final boolean isLockout = errorCode == BiometricConstants.BIOMETRIC_ERROR_LOCKOUT
+ || errorCode == BiometricConstants.BIOMETRIC_ERROR_LOCKOUT_PERMANENT;
+ if (mCurrentDialog.isAllowDeviceCredentials() && isLockout) {
+ mCurrentDialog.animateToCredentialUI();
+ } else {
+ mCurrentDialog.onError(error);
+ }
}
@Override