[DO NOT MERGE] fingerprint: handle PerformanceStats NULL pointers am: 3615be74c1

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

Change-Id: I57e2b436909bf4302fec7fc3f1de11097a047011
This commit is contained in:
Ícaro Hoff
2020-09-28 01:02:58 +00:00
committed by Automerger Merge Worker

View File

@@ -284,11 +284,13 @@ public abstract class BiometricServiceBase extends SystemService
@Override @Override
public int handleFailedAttempt() { public int handleFailedAttempt() {
final int lockoutMode = getLockoutMode(); final int lockoutMode = getLockoutMode();
if (mPerformanceStats != null) {
if (lockoutMode == AuthenticationClient.LOCKOUT_PERMANENT) { if (lockoutMode == AuthenticationClient.LOCKOUT_PERMANENT) {
mPerformanceStats.permanentLockout++; mPerformanceStats.permanentLockout++;
} else if (lockoutMode == AuthenticationClient.LOCKOUT_TIMED) { } else if (lockoutMode == AuthenticationClient.LOCKOUT_TIMED) {
mPerformanceStats.lockout++; mPerformanceStats.lockout++;
} }
}
// Failing multiple times will continue to push out the lockout time // Failing multiple times will continue to push out the lockout time
if (lockoutMode != AuthenticationClient.LOCKOUT_NONE) { if (lockoutMode != AuthenticationClient.LOCKOUT_NONE) {
@@ -730,12 +732,14 @@ public abstract class BiometricServiceBase extends SystemService
if (client != null && client.onAuthenticated(identifier, authenticated, token)) { if (client != null && client.onAuthenticated(identifier, authenticated, token)) {
removeClient(client); removeClient(client);
} }
if (mPerformanceStats != null) {
if (authenticated) { if (authenticated) {
mPerformanceStats.accept++; mPerformanceStats.accept++;
} else { } else {
mPerformanceStats.reject++; mPerformanceStats.reject++;
} }
} }
}
protected void handleEnrollResult(BiometricAuthenticator.Identifier identifier, protected void handleEnrollResult(BiometricAuthenticator.Identifier identifier,
int remaining) { int remaining) {