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

Commit ea42d4ed authored by Jorim Jaggi's avatar Jorim Jaggi Committed by Android Git Automerger
Browse files

am 9f74303e: Track unlock attempts per user.

* commit '9f74303e':
  Track unlock attempts per user.
parents 7e66f6f4 9f74303e
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -260,7 +260,6 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe
        if (DEBUG) Log.d(TAG, "reportFailedPatternAttempt: #" + failedAttempts);

        SecurityMode mode = mSecurityModel.getSecurityMode();
        final boolean usingPattern = mode == KeyguardSecurityModel.SecurityMode.Pattern;
        final int currentUser = KeyguardUpdateMonitor.getCurrentUser();
        final DevicePolicyManager dpm = mLockPatternUtils.getDevicePolicyManager();
        final int failedAttemptsBeforeWipe =
+8 −15
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@ import android.telephony.SubscriptionManager.OnSubscriptionsChangedListener;
import android.telephony.TelephonyManager;
import android.util.Log;
import android.util.SparseBooleanArray;
import android.util.SparseIntArray;

import com.google.android.collect.Lists;

@@ -139,7 +140,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
    private BatteryStatus mBatteryStatus;

    // Password attempts
    private int mFailedAttempts = 0;
    private SparseIntArray mFailedAttempts = new SparseIntArray();

    private boolean mClockVisible;

@@ -1260,28 +1261,20 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
        return mDeviceProvisioned;
    }

    public int getFailedUnlockAttempts() {
        return mFailedAttempts;
    }

    public void clearFailedUnlockAttempts() {
        mFailedAttempts = 0;
        mFailedAttempts.delete(sCurrentUser);
    }

    public void clearFingerprintRecognized() {
        mUserFingerprintAuthenticated.clear();
    public int getFailedUnlockAttempts() {
        return mFailedAttempts.get(sCurrentUser, 0);
    }

    public void reportFailedUnlockAttempt() {
        mFailedAttempts++;
    }

    public boolean isClockVisible() {
        return mClockVisible;
        mFailedAttempts.put(sCurrentUser, getFailedUnlockAttempts() + 1);
    }

    public int getPhoneState() {
        return mPhoneState;
    public void clearFingerprintRecognized() {
        mUserFingerprintAuthenticated.clear();
    }

    public boolean isSimPinVoiceSecure() {