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

Commit 2bc621b8 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Remove co-ex logic for blocking face help msgs" into tm-dev am: a9b6e8c3

parents cb937579 a9b6e8c3
Loading
Loading
Loading
Loading
+0 −19
Original line number Diff line number Diff line
@@ -987,11 +987,6 @@ public class KeyguardIndicationController {
                mStatusBarKeyguardViewManager.showBouncerMessage(helpString,
                        mInitialTextColorState);
            } else if (mScreenLifecycle.getScreenState() == SCREEN_ON) {
                if (biometricSourceType == BiometricSourceType.FACE
                        && shouldSuppressFaceMsgAndShowTryFingerprintMsg()) {
                    showFaceFailedTryFingerprintMsg(msgId, helpString);
                    return;
                }
                showBiometricMessage(helpString);
            } else if (showActionToUnlock) {
                mHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_SHOW_ACTION_TO_UNLOCK),
@@ -1005,13 +1000,6 @@ public class KeyguardIndicationController {
            if (shouldSuppressBiometricError(msgId, biometricSourceType, mKeyguardUpdateMonitor)) {
                return;
            }
            if (biometricSourceType == BiometricSourceType.FACE
                    && shouldSuppressFaceMsgAndShowTryFingerprintMsg()
                    && !mStatusBarKeyguardViewManager.isBouncerShowing()
                    && mScreenLifecycle.getScreenState() == SCREEN_ON) {
                showFaceFailedTryFingerprintMsg(msgId, errString);
                return;
            }
            if (msgId == FaceManager.FACE_ERROR_TIMEOUT) {
                // The face timeout message is not very actionable, let's ask the user to
                // manually retry.
@@ -1058,13 +1046,6 @@ public class KeyguardIndicationController {
                    || msgId == FingerprintManager.FINGERPRINT_ERROR_USER_CANCELED);
        }

        private boolean shouldSuppressFaceMsgAndShowTryFingerprintMsg() {
            // For dual biometric, don't show face auth messages
            return mKeyguardUpdateMonitor.isFingerprintDetectionRunning()
                    && mKeyguardUpdateMonitor.isUnlockingWithBiometricAllowed(
                            true /* isStrongBiometric */);
        }

        private boolean shouldSuppressFaceError(int msgId, KeyguardUpdateMonitor updateMonitor) {
            // Only checking if unlocking with Biometric is allowed (no matter strong or non-strong
            // as long as primary auth, i.e. PIN/pattern/password, is not required), so it's ok to
+0 −27
Original line number Diff line number Diff line
@@ -751,33 +751,6 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
        verifyTransientMessage(message);
    }

    @Test
    public void faceAuthMessageSuppressed() {
        createController();
        String faceHelpMsg = "Face auth help message";

        // GIVEN state of showing message when keyguard screen is on
        when(mKeyguardUpdateMonitor.isUnlockingWithBiometricAllowed(anyBoolean())).thenReturn(true);
        when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(false);

        // GIVEN fingerprint is also running (not udfps)
        when(mKeyguardUpdateMonitor.isFingerprintDetectionRunning()).thenReturn(true);
        when(mKeyguardUpdateMonitor.isUdfpsSupported()).thenReturn(false);

        mController.setVisible(true);

        // WHEN a face help message comes in
        mController.getKeyguardCallback().onBiometricHelp(
                KeyguardUpdateMonitor.BIOMETRIC_HELP_FACE_NOT_RECOGNIZED, faceHelpMsg,
                BiometricSourceType.FACE);

        // THEN no help message appears
        verify(mRotateTextViewController, never()).showTransient(anyString());

        // THEN the face help message is still announced for a11y
        verify(mIndicationAreaBottom).announceForAccessibility(eq(faceHelpMsg));
    }

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