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

Commit 881de355 authored by Joe Bolinger's avatar Joe Bolinger Committed by Android (Google) Code Review
Browse files

Merge "Supress fingerprint cancellation messages in lock screen." into sc-dev

parents c80b0a8f 72cd1878
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -924,7 +924,8 @@ public class KeyguardIndicationController implements KeyguardStateController.Cal
            // check of whether non-strong biometric is allowed
            return ((!updateMonitor.isUnlockingWithBiometricAllowed(true /* isStrongBiometric */)
                    && msgId != FingerprintManager.FINGERPRINT_ERROR_LOCKOUT_PERMANENT)
                    || msgId == FingerprintManager.FINGERPRINT_ERROR_CANCELED);
                    || msgId == FingerprintManager.FINGERPRINT_ERROR_CANCELED
                    || msgId == FingerprintManager.FINGERPRINT_ERROR_USER_CANCELED);
        }

        private boolean shouldSuppressFaceError(int msgId, KeyguardUpdateMonitor updateMonitor) {
+20 −0
Original line number Diff line number Diff line
@@ -473,6 +473,22 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
        assertThat(mTextView.getText()).isNotEqualTo(message);
    }

    @Test
    public void transientIndication_visibleWhenDozing_ignoresFingerprintCancellation() {
        createController();

        mController.setVisible(true);
        reset(mRotateTextViewController);
        mController.getKeyguardCallback().onBiometricError(
                FingerprintManager.FINGERPRINT_ERROR_USER_CANCELED, "foo",
                BiometricSourceType.FINGERPRINT);
        mController.getKeyguardCallback().onBiometricError(
                FingerprintManager.FINGERPRINT_ERROR_CANCELED, "bar",
                BiometricSourceType.FINGERPRINT);

        verifyNoTransientMessage();
    }

    @Test
    public void transientIndication_swipeUpToRetry() {
        createController();
@@ -668,4 +684,8 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
    private void verifyTransientMessage(String message) {
        verify(mRotateTextViewController).showTransient(eq(message), anyBoolean());
    }

    private void verifyNoTransientMessage() {
        verify(mRotateTextViewController, never()).showTransient(any(), anyBoolean());
    }
}