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

Commit 1d6a2867 authored by Kevin Chyn's avatar Kevin Chyn
Browse files

Don't invoke resetLockout when not enrolled

Fixes: 129559946

Test: lockout reset still works
Change-Id: I568429f729c75131baa8056ec559a7d5397ead71
parent d6ecaf06
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -46,9 +46,9 @@ import android.os.RemoteException;
import android.os.SELinux;
import android.os.UserHandle;
import android.os.UserManager;
import android.service.restricted_image.RestrictedImagesDumpProto;
import android.service.restricted_image.RestrictedImageProto;
import android.service.restricted_image.RestrictedImageSetProto;
import android.service.restricted_image.RestrictedImagesDumpProto;
import android.util.Slog;
import android.util.proto.ProtoOutputStream;

@@ -383,6 +383,12 @@ public class FaceService extends BiometricServiceBase {
        @Override // Binder call
        public void resetLockout(byte[] token) {
            checkPermission(MANAGE_BIOMETRIC);

            if (!FaceService.this.hasEnrolledBiometrics(mCurrentUserId)) {
                Slog.w(TAG, "Ignoring lockout reset, no templates enrolled");
                return;
            }

            try {
                mDaemonWrapper.resetLockout(token);
            } catch (RemoteException e) {
+6 −0
Original line number Diff line number Diff line
@@ -419,6 +419,12 @@ public class FingerprintService extends BiometricServiceBase {
        @Override // Binder call
        public void resetTimeout(byte [] token) {
            checkPermission(RESET_FINGERPRINT_LOCKOUT);

            if (!FingerprintService.this.hasEnrolledBiometrics(mCurrentUserId)) {
                Slog.w(TAG, "Ignoring lockout reset, no templates enrolled");
                return;
            }

            // TODO: confirm security token when we move timeout management into the HAL layer.
            mHandler.post(mResetFailedAttemptsForCurrentUserRunnable);
        }