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

Commit 2aab446b authored by Diya Bera's avatar Diya Bera Committed by Android (Google) Code Review
Browse files

Merge "Invoke callback in AuthController#hideAuthenticationDialog" into main

parents fa714fb0 676753e6
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -800,6 +800,20 @@ public class AuthControllerTest extends SysuiTestCase {
        verify(callback).onBiometricPromptDismissed();
    }

    @Test
    public void testOnBiometricPromptDismissedCallback_hideAuthenticationDialog() {
        // GIVEN a callback is registered
        AuthController.Callback callback = mock(AuthController.Callback.class);
        mAuthController.addCallback(callback);

        // WHEN dialog is shown and then dismissed
        showDialog(new int[]{1} /* sensorIds */, false /* credentialAllowed */);
        mAuthController.hideAuthenticationDialog(mAuthController.mCurrentDialog.getRequestId());

        // THEN callback should be received
        verify(callback).onBiometricPromptDismissed();
    }

    @Test
    public void testSubscribesToLogContext() {
        mAuthController.setBiometricContextListener(mContextListener);
+3 −0
Original line number Diff line number Diff line
@@ -1127,6 +1127,9 @@ public class AuthController implements
        }

        mCurrentDialog.dismissFromSystemServer();
        for (Callback cb : mCallbacks) {
            cb.onBiometricPromptDismissed();
        }

        // BiometricService will have already sent the callback to the client in this case.
        // This avoids a round trip to SystemUI. So, just dismiss the dialog and we're done.