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

Commit 7019325e authored by Brian Colonna's avatar Brian Colonna
Browse files

Bug 6605167: Turning off FUL during error counts as attempt

If FUL was turned off while the error message was displayed it would
not count as a failed attempt.  This commit changes the
reportFailedAttempt callback to just report the failure rather than
report the failure and close.  This allows the FUL service to send the
reportFailedAttempt message earlier and then later close using the
existing cancel function, which closes without reporting a failed
attempt.

Change-Id: Ib3b76f477a98b149fcccc32ac39ecaeccd88a7e2
parent ce4eeadf
Loading
Loading
Loading
Loading
+4 −14
Original line number Original line Diff line number Diff line
@@ -375,8 +375,7 @@ public class FaceUnlock implements BiometricSensorUnlock, Handler.Callback {
    }
    }


    /**
    /**
     * Stops the Face Unlock service and exposes the backup lock.  Called when the user presses the
     * Stops the Face Unlock service and exposes the backup lock.
     * cancel button to skip Face Unlock, no face is detected or there is an error.
     */
     */
    void handleCancel() {
    void handleCancel() {
        if (DEBUG) Log.d(TAG, "handleCancel()");
        if (DEBUG) Log.d(TAG, "handleCancel()");
@@ -390,19 +389,11 @@ public class FaceUnlock implements BiometricSensorUnlock, Handler.Callback {
    }
    }


    /**
    /**
     * Stops the Face Unlock service and exposes the backup lock, reporting a failed unlock attempt.
     * Increments the number of failed Face Unlock attempts.
     * Called when Face Unlock denies access to the user.
     */
     */
    void handleReportFailedAttempt() {
    void handleReportFailedAttempt() {
        if (DEBUG) Log.d(TAG, "handleReportFailedAttempt()");
        if (DEBUG) Log.d(TAG, "handleReportFailedAttempt()");
        mUpdateMonitor.reportFailedBiometricUnlockAttempt();
        mUpdateMonitor.reportFailedBiometricUnlockAttempt();
        if (mFaceUnlockView != null) {
            mFaceUnlockView.setVisibility(View.INVISIBLE);
        } else {
            Log.e(TAG, "mFaceUnlockView is null in handleReportFailedAttempt()");
        }
        stop();
        mKeyguardScreenCallback.pokeWakelock(BACKUP_LOCK_TIMEOUT);
    }
    }


    /**
    /**
@@ -521,8 +512,7 @@ public class FaceUnlock implements BiometricSensorUnlock, Handler.Callback {
        }
        }


        /**
        /**
         * Called when the user presses cancel to skip Face Unlock, a face cannot be found or
         * Called when Face Unlock wants to go to the backup.
         * there is an error.
         */
         */
        @Override
        @Override
        public void cancel() {
        public void cancel() {
@@ -531,7 +521,7 @@ public class FaceUnlock implements BiometricSensorUnlock, Handler.Callback {
        }
        }


        /**
        /**
         * Called when Face Unlock denies access to the user.
         * Called when Face Unlock wants to increment the number of failed attempts.
         */
         */
        @Override
        @Override
        public void reportFailedAttempt() {
        public void reportFailedAttempt() {