Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 72c35498 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Run error callback when BiometricPrompt dismissed early" into...

Merge "Run error callback when BiometricPrompt dismissed early" into rvc-qpr-dev-plus-aosp am: 369dfd2a

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13082517

Change-Id: I2f2d7a69905823d56d26d83386bad23713e1e999
parents a6c32cb0 369dfd2a
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -101,7 +101,7 @@ public class AuthContainerView extends LinearLayout

    @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.
    @Nullable @AuthDialogCallback.DismissedReason Integer mPendingCallbackReason;
@@ -632,10 +632,11 @@ public class AuthContainerView extends LinearLayout
        mWindowManager.removeView(this);
    }

    private void onDialogAnimatedIn() {
    @VisibleForTesting
    void onDialogAnimatedIn() {
        if (mContainerState == STATE_PENDING_DISMISS) {
            Log.d(TAG, "onDialogAnimatedIn(): mPendingDismissDialog=true, dismissing now");
            animateAway(false /* sendReason */, 0);
            animateAway(AuthDialogCallback.DISMISSED_USER_CANCELED);
            return;
        }
        mContainerState = STATE_SHOWING;
+10 −0
Original line number Diff line number Diff line
@@ -210,6 +210,16 @@ public class AuthContainerViewTest extends SysuiTestCase {
                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
    public void testLayoutParams_hasSecureWindowFlag() {
        final IBinder windowToken = mock(IBinder.class);