Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9b48a29c authored by Ícaro Hoff's avatar Ícaro Hoff Committed by Michael Bestas
Browse files

fingerprint: handle PerformanceStats NULL pointers



bcc100aa 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: default avatarÍcaro Hoff <icarohoff@gmail.com>
parent 67ffb9a8
Loading
Loading
Loading
Loading
+12 −8
Original line number Diff line number Diff line
@@ -263,11 +263,13 @@ public abstract class BiometricServiceBase extends SystemService
        @Override
        public int handleFailedAttempt() {
            final int lockoutMode = getLockoutMode();
            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
            if (lockoutMode != AuthenticationClient.LOCKOUT_NONE) {
@@ -697,12 +699,14 @@ public abstract class BiometricServiceBase extends SystemService
        if (client != null && client.onAuthenticated(identifier, authenticated, token)) {
            removeClient(client);
        }
        if (mPerformanceStats != null) {
            if (authenticated) {
                mPerformanceStats.accept++;
            } else {
                mPerformanceStats.reject++;
            }
        }
    }

    protected void handleEnrollResult(BiometricAuthenticator.Identifier identifier,
            int remaining) {