[DO NOT MERGE] fingerprint: handle PerformanceStats NULL pointers am: 3615be74c1 am: eea53b512c am: 3f78dbf336 am: 42d8fb924c

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1439198

Change-Id: Id5accd254cbc3439e47f47c77e1b8db8f29c93f9
This commit is contained in:
Ícaro Hoff
2020-09-28 02:21:25 +00:00
committed by Automerger Merge Worker

View File

@@ -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
@@ -729,10 +731,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++;
}
}
}