Merge "Run error callback when BiometricPrompt dismissed early" into rvc-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
22ac0c0bd9
@@ -96,7 +96,7 @@ public class AuthContainerView extends LinearLayout
|
|||||||
|
|
||||||
@VisibleForTesting final WakefulnessLifecycle mWakefulnessLifecycle;
|
@VisibleForTesting final WakefulnessLifecycle mWakefulnessLifecycle;
|
||||||
|
|
||||||
private @ContainerState int mContainerState = STATE_UNKNOWN;
|
@VisibleForTesting @ContainerState int mContainerState = STATE_UNKNOWN;
|
||||||
|
|
||||||
// Non-null only if the dialog is in the act of dismissing and has not sent the reason yet.
|
// Non-null only if the dialog is in the act of dismissing and has not sent the reason yet.
|
||||||
@Nullable @AuthDialogCallback.DismissedReason Integer mPendingCallbackReason;
|
@Nullable @AuthDialogCallback.DismissedReason Integer mPendingCallbackReason;
|
||||||
@@ -607,10 +607,11 @@ public class AuthContainerView extends LinearLayout
|
|||||||
mWindowManager.removeView(this);
|
mWindowManager.removeView(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onDialogAnimatedIn() {
|
@VisibleForTesting
|
||||||
|
void onDialogAnimatedIn() {
|
||||||
if (mContainerState == STATE_PENDING_DISMISS) {
|
if (mContainerState == STATE_PENDING_DISMISS) {
|
||||||
Log.d(TAG, "onDialogAnimatedIn(): mPendingDismissDialog=true, dismissing now");
|
Log.d(TAG, "onDialogAnimatedIn(): mPendingDismissDialog=true, dismissing now");
|
||||||
animateAway(false /* sendReason */, 0);
|
animateAway(AuthDialogCallback.DISMISSED_USER_CANCELED);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mContainerState = STATE_SHOWING;
|
mContainerState = STATE_SHOWING;
|
||||||
|
|||||||
@@ -203,6 +203,16 @@ public class AuthContainerViewTest extends SysuiTestCase {
|
|||||||
eq(View.IMPORTANT_FOR_ACCESSIBILITY_NO));
|
eq(View.IMPORTANT_FOR_ACCESSIBILITY_NO));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testOnDialogAnimatedIn_sendsCancelReason_whenPendingDismiss() {
|
||||||
|
initializeContainer(Authenticators.BIOMETRIC_WEAK);
|
||||||
|
mAuthContainer.mContainerState = AuthContainerView.STATE_PENDING_DISMISS;
|
||||||
|
mAuthContainer.onDialogAnimatedIn();
|
||||||
|
verify(mCallback).onDismissed(
|
||||||
|
eq(AuthDialogCallback.DISMISSED_USER_CANCELED),
|
||||||
|
eq(null) /* credentialAttestation */);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testLayoutParams_hasSecureWindowFlag() {
|
public void testLayoutParams_hasSecureWindowFlag() {
|
||||||
final IBinder windowToken = mock(IBinder.class);
|
final IBinder windowToken = mock(IBinder.class);
|
||||||
|
|||||||
Reference in New Issue
Block a user