Merge "Update to 2 failed udfps attempts to show bouncer" into sc-v2-dev am: 6445db669e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16422817 Change-Id: Iafd3fcde98dfd3676dda4646203f947a284690aa
This commit is contained in:
@@ -74,7 +74,7 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp
|
|||||||
private static final long BIOMETRIC_WAKELOCK_TIMEOUT_MS = 15 * 1000;
|
private static final long BIOMETRIC_WAKELOCK_TIMEOUT_MS = 15 * 1000;
|
||||||
private static final String BIOMETRIC_WAKE_LOCK_NAME = "wake-and-unlock:wakelock";
|
private static final String BIOMETRIC_WAKE_LOCK_NAME = "wake-and-unlock:wakelock";
|
||||||
private static final UiEventLogger UI_EVENT_LOGGER = new UiEventLoggerImpl();
|
private static final UiEventLogger UI_EVENT_LOGGER = new UiEventLoggerImpl();
|
||||||
private static final int FP_ATTEMPTS_BEFORE_SHOW_BOUNCER = 3;
|
private static final int FP_ATTEMPTS_BEFORE_SHOW_BOUNCER = 2;
|
||||||
|
|
||||||
@IntDef(prefix = { "MODE_" }, value = {
|
@IntDef(prefix = { "MODE_" }, value = {
|
||||||
MODE_NONE,
|
MODE_NONE,
|
||||||
|
|||||||
@@ -381,16 +381,15 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void onUdfpsConsecutivelyFailedThreeTimes_showBouncer() {
|
public void onUdfpsConsecutivelyFailedTwoTimes_showBouncer() {
|
||||||
// GIVEN UDFPS is supported
|
// GIVEN UDFPS is supported
|
||||||
when(mUpdateMonitor.isUdfpsSupported()).thenReturn(true);
|
when(mUpdateMonitor.isUdfpsSupported()).thenReturn(true);
|
||||||
|
|
||||||
// WHEN udfps fails twice - then don't show the bouncer
|
// WHEN udfps fails once - then don't show the bouncer
|
||||||
mBiometricUnlockController.onBiometricAuthFailed(BiometricSourceType.FINGERPRINT);
|
|
||||||
mBiometricUnlockController.onBiometricAuthFailed(BiometricSourceType.FINGERPRINT);
|
mBiometricUnlockController.onBiometricAuthFailed(BiometricSourceType.FINGERPRINT);
|
||||||
verify(mStatusBarKeyguardViewManager, never()).showBouncer(anyBoolean());
|
verify(mStatusBarKeyguardViewManager, never()).showBouncer(anyBoolean());
|
||||||
|
|
||||||
// WHEN udfps fails the third time
|
// WHEN udfps fails the second time
|
||||||
mBiometricUnlockController.onBiometricAuthFailed(BiometricSourceType.FINGERPRINT);
|
mBiometricUnlockController.onBiometricAuthFailed(BiometricSourceType.FINGERPRINT);
|
||||||
|
|
||||||
// THEN show the bouncer
|
// THEN show the bouncer
|
||||||
|
|||||||
Reference in New Issue
Block a user