diff options
| author | 2017-06-04 12:17:51 -0300 | |
|---|---|---|
| committer | 2020-09-27 21:42:31 +0000 | |
| commit | 3615be74c1a499c558e09a45dd7409e9f1027be2 (patch) | |
| tree | acebe7c834ddd0ee4f27844faffd3187f8b913fa | |
| parent | f29902285a56562b8993a0cbce337bf4c895f406 (diff) | |
[DO NOT MERGE] fingerprint: handle PerformanceStats NULL pointers
bcc100a has added support for this feature, but the NULL checks
weren't complete, only "handleAcquired" was checking if PerformanceStats
was supported before calling the API.
Extend the NULL checks to "handleAuthenticated" and "handleFailedAttempt"
calls as well.
Change-Id: I3cc9b35ea6b81dc0c503b9feab940873b344323e
Signed-off-by: Ícaro Hoff <icarohoff@gmail.com>
| -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 ff8c628e785b..7cdd3b3a42fe 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++; + } } } |