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

Commit 873010df authored by Adrian Roos's avatar Adrian Roos
Browse files

Disable fingerprint after user lockout

Bug: 22677859
Change-Id: I38b918d2e40b5bb423f2e5c171fe65bed8d440a6
parent 26b555d4
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1275,6 +1275,12 @@ public class LockPatternUtils {
         */
        public static final int SOME_AUTH_REQUIRED_AFTER_USER_REQUEST = 0x4;

        /**
         * Strong authentication is required because the user has been locked out after too many
         * attempts.
         */
        public static final int STRONG_AUTH_REQUIRED_AFTER_LOCKOUT = 0x8;

        public static final int DEFAULT = STRONG_AUTH_REQUIRED_AFTER_BOOT;
        private static final int ALLOWING_FINGERPRINT = SOME_AUTH_REQUIRED_AFTER_USER_REQUEST;

+6 −0
Original line number Diff line number Diff line
@@ -29,6 +29,8 @@ import android.content.pm.UserInfo;
import static android.Manifest.permission.ACCESS_KEYGUARD_SECURE_STORAGE;
import static android.content.Context.USER_SERVICE;
import static android.Manifest.permission.READ_CONTACTS;
import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_LOCKOUT;

import android.database.sqlite.SQLiteDatabase;
import android.os.Binder;
import android.os.IBinder;
@@ -664,6 +666,10 @@ public class LockSettingsService extends ILockSettings.Stub {
            if (shouldReEnroll) {
                credentialUtil.setCredential(credential, credential, userId);
            }
        } else if (response.getResponseCode() == VerifyCredentialResponse.RESPONSE_RETRY) {
            if (response.getTimeout() > 0) {
                requireStrongAuth(STRONG_AUTH_REQUIRED_AFTER_LOCKOUT, userId);
            }
        }

        return response;