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

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

Merge "Check for race condition between onAuthenticated and taskStackChanged"

parents e9bcb328 c79856b4
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -232,6 +232,7 @@ public abstract class AuthenticationClient extends ClientMonitor {
    public boolean onAuthenticated(BiometricAuthenticator.Identifier identifier,
            boolean authenticated, ArrayList<Byte> token) {
        if (authenticated) {
            mAlreadyDone = true;
            if (mRequireConfirmation) {
                // Store the token so it can be sent to keystore after the user presses confirm
                mEscrow = new TokenEscrow(identifier, token);
+2 −1
Original line number Diff line number Diff line
@@ -408,7 +408,8 @@ public abstract class BiometricServiceBase extends SystemService
                        mActivityTaskManager.getTasks(1);
                if (!runningTasks.isEmpty()) {
                    final String topPackage = runningTasks.get(0).topActivity.getPackageName();
                    if (!topPackage.contentEquals(currentClient)) {
                    if (!topPackage.contentEquals(currentClient)
                            && !mCurrentClient.isAlreadyDone()) {
                        Slog.e(getTag(), "Stopping background authentication, top: " + topPackage
                                + " currentClient: " + currentClient);
                        mCurrentClient.stop(false /* initiatedByClient */);
+6 −0
Original line number Diff line number Diff line
@@ -63,6 +63,7 @@ public abstract class ClientMonitor implements IBinder.DeathRecipient {
    protected final Metrics mMetrics;

    protected boolean mAlreadyCancelled;
    protected boolean mAlreadyDone;

    /**
     * @param context context of BiometricService
@@ -136,6 +137,11 @@ public abstract class ClientMonitor implements IBinder.DeathRecipient {
    public abstract boolean onEnumerationResult(
            BiometricAuthenticator.Identifier identifier, int remaining);


    public boolean isAlreadyDone() {
        return mAlreadyDone;
    }

    /**
     * Called when we get notification from the biometric's HAL that an image has been acquired.
     * Common to authenticate and enroll.