Merge "Fix enumerate corner case" into qt-dev

This commit is contained in:
Kevin Chyn
2019-04-05 04:24:04 +00:00
committed by Android (Google) Code Review

View File

@@ -1044,10 +1044,15 @@ public abstract class BiometricServiceBase extends SystemService
} }
} else { } else {
currentClient.stop(initiatedByClient); currentClient.stop(initiatedByClient);
}
mPendingClient = newClient; // Only post the reset runnable for non-cleanup clients. Cleanup clients should
// never be forcibly stopped since they ensure synchronization between HAL and
// framework. Thus, we should instead just start the pending client once cleanup
// finishes instead of using the reset runnable.
mHandler.removeCallbacks(mResetClientState); mHandler.removeCallbacks(mResetClientState);
mHandler.postDelayed(mResetClientState, CANCEL_TIMEOUT_LIMIT); mHandler.postDelayed(mResetClientState, CANCEL_TIMEOUT_LIMIT);
}
mPendingClient = newClient;
} else if (newClient != null) { } else if (newClient != null) {
// For BiometricPrompt clients, do not start until // For BiometricPrompt clients, do not start until
// <Biometric>Service#startPreparedClient is called. BiometricService waits until all // <Biometric>Service#startPreparedClient is called. BiometricService waits until all
@@ -1224,6 +1229,7 @@ public abstract class BiometricServiceBase extends SystemService
} else { } else {
clearEnumerateState(); clearEnumerateState();
if (mPendingClient != null) { if (mPendingClient != null) {
Slog.d(getTag(), "Enumerate finished, starting pending client");
startClient(mPendingClient, false /* initiatedByClient */); startClient(mPendingClient, false /* initiatedByClient */);
} }
} }