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

Commit 72cd1878 authored by Joe Bolinger's avatar Joe Bolinger
Browse files

Supress fingerprint cancellation messages in lock screen.

Fix: 185208300

Test: atest com.android.systemui.statusbar.KeyguardIndicationControllerTest
Test: manually on device
Change-Id: I0b383f86ff09be82160bc7f279d15b484d047559
parent 2db08cea
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());
    }
}