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

Commit 4fecb824 authored by Joe Bolinger's avatar Joe Bolinger Committed by Automerger Merge Worker
Browse files

Merge "Supress fingerprint cancellation messages in lock screen." into sc-dev am: 881de355

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

Change-Id: Ib426ec587e151d07b2e2d15ffbdb211bd8524de6
parents dc152616 881de355
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());
    }
}