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

Commit a0cd8eb5 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix AuthenticationCallback leak in FingerprintManager" into oc-dev

parents 97578e31 d717808b
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -42,8 +42,8 @@ import javax.crypto.Cipher;
import javax.crypto.Mac;

import static android.Manifest.permission.INTERACT_ACROSS_USERS;
import static android.Manifest.permission.USE_FINGERPRINT;
import static android.Manifest.permission.MANAGE_FINGERPRINT;
import static android.Manifest.permission.USE_FINGERPRINT;

/**
 * A class that coordinates access to the fingerprint hardware.
@@ -910,6 +910,7 @@ public class FingerprintManager {
            } else if (mAuthenticationCallback != null) {
                mAuthenticationCallback.onAuthenticationError(clientErrMsgId,
                        getErrorString(errMsgId, vendorCode));
                mAuthenticationCallback = null;
            } else if (mRemovalCallback != null) {
                mRemovalCallback.onRemovalError(mRemovalFingerprint, clientErrMsgId,
                        getErrorString(errMsgId, vendorCode));
@@ -930,12 +931,14 @@ public class FingerprintManager {
                final AuthenticationResult result =
                        new AuthenticationResult(mCryptoObject, fp, userId);
                mAuthenticationCallback.onAuthenticationSucceeded(result);
                mAuthenticationCallback = null;
            }
        }

        private void sendAuthenticatedFailed() {
            if (mAuthenticationCallback != null) {
                mAuthenticationCallback.onAuthenticationFailed();
                mAuthenticationCallback = null;
            }
        }