Merge "[Bouncer] Only show swipe up and try again..." into tm-qpr-dev

This commit is contained in:
Aaron Liu
2023-01-05 18:18:48 +00:00
committed by Android (Google) Code Review
2 changed files with 18 additions and 1 deletions

View File

@@ -930,7 +930,8 @@ public class KeyguardIndicationController {
if (mStatusBarKeyguardViewManager.isBouncerShowing()) {
if (mStatusBarKeyguardViewManager.isShowingAlternateBouncer()) {
return; // udfps affordance is highlighted, no need to show action to unlock
} else if (mKeyguardUpdateMonitor.isFaceEnrolled()) {
} else if (mKeyguardUpdateMonitor.isFaceEnrolled()
&& !mKeyguardUpdateMonitor.getIsFaceAuthenticated()) {
String message = mContext.getString(R.string.keyguard_retry);
mStatusBarKeyguardViewManager.setKeyguardMessage(message, mInitialTextColorState);
}

View File

@@ -661,6 +661,7 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
String message = mContext.getString(R.string.keyguard_retry);
when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(true);
when(mKeyguardUpdateMonitor.isFaceEnrolled()).thenReturn(true);
when(mKeyguardUpdateMonitor.getIsFaceAuthenticated()).thenReturn(false);
mController.setVisible(true);
mController.getKeyguardCallback().onBiometricError(FACE_ERROR_TIMEOUT,
@@ -669,6 +670,21 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
verify(mStatusBarKeyguardViewManager).setKeyguardMessage(eq(message), any());
}
@Test
public void transientIndication_swipeUpToRetry_faceAuthenticated() {
createController();
String message = mContext.getString(R.string.keyguard_retry);
when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(true);
when(mKeyguardUpdateMonitor.getIsFaceAuthenticated()).thenReturn(true);
when(mKeyguardUpdateMonitor.isFaceEnrolled()).thenReturn(true);
mController.setVisible(true);
mController.getKeyguardCallback().onBiometricError(FACE_ERROR_TIMEOUT,
"A message", BiometricSourceType.FACE);
verify(mStatusBarKeyguardViewManager, never()).setKeyguardMessage(eq(message), any());
}
@Test
public void faceErrorTimeout_whenFingerprintEnrolled_doesNotShowMessage() {
createController();