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

Commit dca49887 authored by Diya Bera's avatar Diya Bera
Browse files

Treat unable to process error as a soft error

Fixes: 408453838
Test: atest AuthControllerTest
Flag: EXEMPT bug fix
Change-Id: I60284c69e35285bef6aeb429283f42e4ec482399
parent 219b071f
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);