OSDN Git Service

FingerprintSettings should handle FINGERPRINT_ERROR_LOCKOUT_PERMANENT
authorKevin Chyn <kchyn@google.com>
Tue, 20 Jun 2017 21:24:43 +0000 (14:24 -0700)
committerKevin Chyn <kchyn@google.com>
Tue, 20 Jun 2017 21:24:43 +0000 (14:24 -0700)
Fixes: 62681560

Test: open fingerprint settings, use an unenrolled fingerprint to
authenticate 20 times in a row. Look at logs and it shouldn't be flooded
with fingerprint logs

Change-Id: I59051e8d3a9e040bcd894e956abcbf0497838988

src/com/android/settings/fingerprint/FingerprintSettings.java

index a5595f9..89c3d78 100644 (file)
@@ -261,14 +261,18 @@ public class FingerprintSettings extends SubSettings {
                         mHandler.postDelayed(mFingerprintLockoutReset,
                                 LOCKOUT_DURATION);
                     }
-                    // Fall through to show message
-                default:
-                    // Activity can be null on a screen rotation.
-                    final Activity activity = getActivity();
-                    if (activity != null) {
-                        Toast.makeText(activity, msg , Toast.LENGTH_SHORT);
-                    }
-                break;
+                    break;
+                case FingerprintManager.FINGERPRINT_ERROR_LOCKOUT_PERMANENT:
+                    mInFingerprintLockout = true;
+                    break;
+            }
+
+            if (mInFingerprintLockout) {
+                // Activity can be null on a screen rotation.
+                final Activity activity = getActivity();
+                if (activity != null) {
+                    Toast.makeText(activity, msg , Toast.LENGTH_SHORT).show();
+                }
             }
             retryFingerprint(); // start again
         }