diff options
| author | 2020-09-28 01:31:36 +0000 | |
|---|---|---|
| committer | 2020-09-28 01:31:36 +0000 | |
| commit | 3f78dbf33685a2d2405dfe95c6f4faabd40b13d9 (patch) | |
| tree | 73c828a06e1e10fa1cb44cf9b6da6527334868f1 | |
| parent | 23c923d19768667d5b5cfb401c5811714c952414 (diff) | |
| parent | eea53b512c63b6b6c37186779965e0da14b5e143 (diff) | |
[DO NOT MERGE] fingerprint: handle PerformanceStats NULL pointers am: 3615be74c1 am: eea53b512c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1439198
Change-Id: I20ee6d4a1e32fcde27a495c8064d1895eeeb5e8d
| -rw-r--r-- | services/core/java/com/android/server/biometrics/BiometricServiceBase.java | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/services/core/java/com/android/server/biometrics/BiometricServiceBase.java b/services/core/java/com/android/server/biometrics/BiometricServiceBase.java index 75452ea5fb61..d29b5bd69643 100644 --- a/services/core/java/com/android/server/biometrics/BiometricServiceBase.java +++ b/services/core/java/com/android/server/biometrics/BiometricServiceBase.java @@ -284,10 +284,12 @@ public abstract class BiometricServiceBase extends SystemService @Override public int handleFailedAttempt() { final int lockoutMode = getLockoutMode(); - if (lockoutMode == AuthenticationClient.LOCKOUT_PERMANENT) { - mPerformanceStats.permanentLockout++; - } else if (lockoutMode == AuthenticationClient.LOCKOUT_TIMED) { - mPerformanceStats.lockout++; + if (mPerformanceStats != null) { + if (lockoutMode == AuthenticationClient.LOCKOUT_PERMANENT) { + mPerformanceStats.permanentLockout++; + } else if (lockoutMode == AuthenticationClient.LOCKOUT_TIMED) { + mPerformanceStats.lockout++; + } } // Failing multiple times will continue to push out the lockout time @@ -730,10 +732,12 @@ public abstract class BiometricServiceBase extends SystemService if (client != null && client.onAuthenticated(identifier, authenticated, token)) { removeClient(client); } - if (authenticated) { - mPerformanceStats.accept++; - } else { - mPerformanceStats.reject++; + if (mPerformanceStats != null) { + if (authenticated) { + mPerformanceStats.accept++; + } else { + mPerformanceStats.reject++; + } } } |