summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Kevin Chyn <kchyn@google.com> 2018-04-17 13:50:53 -0700
committer Kevin Chyn <kchyn@google.com> 2018-04-17 13:50:53 -0700
commit58a0d51472ebbe7e66af1b730e1ba184ed967a03 (patch)
tree68267c7d42ac518e8cd387cd1bc364617a85010e
parentb7af9ee423f596c972a1812ccba28a80d7d58d1a (diff)
Don't delay the FINGERPRINT_ERROR_CANCELED message
Test: tested with test APK Change-Id: Ic975870c6f815b5f7dfa4c7f2d8bf5554fbb1c5b Fixes: 78185698
-rw-r--r--core/java/android/hardware/fingerprint/FingerprintManager.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/java/android/hardware/fingerprint/FingerprintManager.java b/core/java/android/hardware/fingerprint/FingerprintManager.java
index 40d31bfe438b..03221d455edb 100644
--- a/core/java/android/hardware/fingerprint/FingerprintManager.java
+++ b/core/java/android/hardware/fingerprint/FingerprintManager.java
@@ -1159,8 +1159,10 @@ public class FingerprintManager implements BiometricFingerprintConstants {
public void onError(long deviceId, int error, int vendorCode) {
if (mExecutor != null) {
// BiometricPrompt case
- if (error == FingerprintManager.FINGERPRINT_ERROR_USER_CANCELED) {
- // User tapped somewhere to cancel, the biometric dialog is already dismissed.
+ if (error == FingerprintManager.FINGERPRINT_ERROR_USER_CANCELED
+ || error == FingerprintManager.FINGERPRINT_ERROR_CANCELED) {
+ // User tapped somewhere to cancel, or authentication was cancelled by the app
+ // or got kicked out. The prompt is already gone, so send the error immediately.
mExecutor.execute(() -> {
sendErrorResult(deviceId, error, vendorCode);
});