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

Commit 6935c33a authored by Kevin Chyn's avatar Kevin Chyn Committed by android-build-merger
Browse files

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

am: a0cd8eb5

Change-Id: If67639ed1f93f76a1ed225209869545572571484
parents 12018de5 a0cd8eb5
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;
            }
        }