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

Commit 19908362 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Treat unable to process error as a soft error" into main

parents 44ec84a5 dca49887
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -527,6 +527,12 @@ public class AuthControllerTest extends SysuiTestCase {
                BiometricConstants.BIOMETRIC_ERROR_TIMEOUT);
    }

    @Test
    public void testOnAuthenticationFailedInvoked_coex_whenFaceAuthRejected_unableToProcess() {
        testOnAuthenticationFailedInvoked_coex_whenFaceAuthRejected(
                BiometricConstants.BIOMETRIC_ERROR_UNABLE_TO_PROCESS);
    }

    private void testOnAuthenticationFailedInvoked_coex_whenFaceAuthRejected(int error) {
        final int modality = BiometricAuthenticator.TYPE_FACE;
        final int userId = 0;
+4 −2
Original line number Diff line number Diff line
@@ -1052,10 +1052,11 @@ public class AuthController implements
                SensorPrivacyManager.TOGGLE_TYPE_SOFTWARE, SensorPrivacyManager.Sensors.CAMERA)) {
            isCameraPrivacyEnabled = true;
        }
        // TODO(b/141025588): Create separate methods for handling hard and soft errors.

        final boolean isSoftError = (error == BiometricConstants.BIOMETRIC_PAUSED_REJECTED
                || error == BiometricConstants.BIOMETRIC_ERROR_TIMEOUT
                || error == BiometricConstants.BIOMETRIC_ERROR_RE_ENROLL
                || error == BiometricConstants.BIOMETRIC_ERROR_UNABLE_TO_PROCESS
                || isCameraPrivacyEnabled);
        if (mCurrentDialog != null) {
            if (mCurrentDialog.isAllowDeviceCredentials() && isLockout) {
@@ -1063,7 +1064,8 @@ public class AuthController implements
                mCurrentDialog.animateToCredentialUI(true /* isError */);
            } else if (isSoftError) {
                final String errorMessage = (error == BiometricConstants.BIOMETRIC_PAUSED_REJECTED
                        || error == BiometricConstants.BIOMETRIC_ERROR_TIMEOUT)
                        || error == BiometricConstants.BIOMETRIC_ERROR_TIMEOUT
                        || error == BiometricConstants.BIOMETRIC_ERROR_UNABLE_TO_PROCESS)
                        ? getNotRecognizedString(modality)
                        : getErrorString(modality, error, vendorCode);
                if (DEBUG) Log.d(TAG, "onBiometricError, soft error: " + errorMessage);