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

Commit 310818ff authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "strong fp lockout after 20 failed attempts" into oc-dev

parents 1835f076 df9d33e9
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -118,6 +118,15 @@ public class FingerprintManager {
     * @hide
     */
    public static final int FINGERPRINT_ERROR_VENDOR = 8;

    /**
     * The operation was canceled because FINGERPRINT_ERROR_LOCKOUT occurred too many times.
     * Fingerprint authentication is disabled until the user unlocks with strong authentication
     * (PIN/Pattern/Password)
     * @hide
     */
    public static final int FINGERPRINT_ERROR_LOCKOUT_PERMANENT = 9;

    /**
     * @hide
     */
@@ -1013,6 +1022,9 @@ public class FingerprintManager {
                return mContext.getString(com.android.internal.R.string.fingerprint_error_canceled);
            case FINGERPRINT_ERROR_LOCKOUT:
                return mContext.getString(com.android.internal.R.string.fingerprint_error_lockout);
            case FINGERPRINT_ERROR_LOCKOUT_PERMANENT:
                return mContext.getString(
                        com.android.internal.R.string.fingerprint_error_lockout_permanent);
            case FINGERPRINT_ERROR_VENDOR: {
                    String[] msgArray = mContext.getResources().getStringArray(
                            com.android.internal.R.array.fingerprint_error_vendor);
+3 −0
Original line number Diff line number Diff line
@@ -54,4 +54,7 @@ message FingerprintActionStatsProto {

    // Total number of lockouts.
    int32 lockout = 4;

    // Total number of permanent lockouts.
    int32 lockout_permanent = 5;
}
+2 −0
Original line number Diff line number Diff line
@@ -1335,6 +1335,8 @@
    <string name="fingerprint_error_canceled">Fingerprint operation canceled.</string>
    <!-- Generic error message shown when the fingerprint operation fails because too many attempts have been made. -->
    <string name="fingerprint_error_lockout">Too many attempts. Try again later.</string>
    <!-- Generic error message shown when the fingerprint operation fails because strong authentication is required -->
    <string name="fingerprint_error_lockout_permanent">Too many attempts. Fingerprint sensor disabled.</string>
    <!-- Generic error message shown when the fingerprint hardware can't recognize the fingerprint -->
    <string name="fingerprint_error_unable_to_process">Try again.</string>

+1 −0
Original line number Diff line number Diff line
@@ -2281,6 +2281,7 @@
  <java-symbol type="array" name="fingerprint_acquired_vendor" />
  <java-symbol type="string" name="fingerprint_error_canceled" />
  <java-symbol type="string" name="fingerprint_error_lockout" />
  <java-symbol type="string" name="fingerprint_error_lockout_permanent" />
  <java-symbol type="string" name="fingerprint_name_template" />

  <!-- Fingerprint config -->
+6 −0
Original line number Diff line number Diff line
@@ -502,6 +502,12 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
            }
        }

        if (msgId == FingerprintManager.FINGERPRINT_ERROR_LOCKOUT_PERMANENT) {
            mLockPatternUtils.requireStrongAuth(
                    LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_LOCKOUT,
                    getCurrentUser());
        }

        for (int i = 0; i < mCallbacks.size(); i++) {
            KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get();
            if (cb != null) {
Loading