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

Commit 6c7d346e authored by Jim Miller's avatar Jim Miller Committed by android-build-merger
Browse files

Merge "Send FINGERPRINT_ERROR_LOCKOUT on some devices" into nyc-dev am: 46768683

am: ef2d4417

* commit 'ef2d4417':
  Send FINGERPRINT_ERROR_LOCKOUT on some devices

Change-Id: I91d27dadb9c44e1767e29777e9067733c60ffc1e
parents fe25edcf ef2d4417
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -74,12 +74,23 @@ public abstract class AuthenticationClient extends ClientMonitor {
        } else {
            result = true; // client not listening
        }
        if (fingerId == 0) {
        if (!authenticated) {
            if (receiver != null) {
                FingerprintUtils.vibrateFingerprintError(getContext());
            }
            // allow system-defined limit of number of attempts before giving up
            result |= handleFailedAttempt();
            boolean inLockoutMode =  handleFailedAttempt();
            // send lockout event in case driver doesn't enforce it.
            if (inLockoutMode) {
                try {
                    Slog.w(TAG, "Forcing lockout (fp driver code should do this!)");
                    receiver.onError(getHalDeviceId(),
                            FingerprintManager.FINGERPRINT_ERROR_LOCKOUT);
                } catch (RemoteException e) {
                    Slog.w(TAG, "Failed to notify lockout:", e);
                }
            }
            result |= inLockoutMode;
        } else {
            if (receiver != null) {
                FingerprintUtils.vibrateFingerprintSuccess(getContext());