diff options
| author | Kevin Chyn <kchyn@google.com> | 2019-08-16 20:28:23 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-08-16 20:28:23 +0000 |
| commit | 04dcb5896ac53b6d835ed652df52015913631a55 (patch) | |
| tree | f556f937a03c622bad345b10eb1dbe7128c85ae9 /core/java/android | |
| parent | 336f7c755d9aef7526db393e4903850a2ea2d607 (diff) | |
| parent | 27fafb76551cfec876c01cfadfa7f9da6056312e (diff) | |
Merge changes from topic "biometric-tests"
* changes:
4/n: Make BiometricDialogView testable
3/n: Move task stack listener to SystemUI
2/n: Update BiometricService with cleaner lifecycle
1/n: Update BiometricDialog (SystemUI side) with cleaner lifecycle
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/hardware/biometrics/BiometricPrompt.java | 26 | ||||
| -rw-r--r-- | core/java/android/hardware/biometrics/IBiometricServiceReceiverInternal.aidl | 4 |
2 files changed, 26 insertions, 4 deletions
diff --git a/core/java/android/hardware/biometrics/BiometricPrompt.java b/core/java/android/hardware/biometrics/BiometricPrompt.java index 1142a07bc66c..fb6b231632f1 100644 --- a/core/java/android/hardware/biometrics/BiometricPrompt.java +++ b/core/java/android/hardware/biometrics/BiometricPrompt.java @@ -100,9 +100,12 @@ public class BiometricPrompt implements BiometricAuthenticator, BiometricConstan /** * @hide */ - public static final int DISMISSED_REASON_POSITIVE = 1; + public static final int DISMISSED_REASON_CONFIRMED = 1; /** + * Dialog is done animating away after user clicked on the button set via + * {@link BiometricPrompt.Builder#setNegativeButton(CharSequence, Executor, + * DialogInterface.OnClickListener)}. * @hide */ public static final int DISMISSED_REASON_NEGATIVE = 2; @@ -112,6 +115,25 @@ public class BiometricPrompt implements BiometricAuthenticator, BiometricConstan */ public static final int DISMISSED_REASON_USER_CANCEL = 3; + /** + * Authenticated, confirmation not required. Dialog animated away. + * @hide + */ + public static final int DISMISSED_REASON_CONFIRM_NOT_REQUIRED = 4; + + /** + * Error message shown on SystemUI. When BiometricService receives this, the UI is already + * gone. + * @hide + */ + public static final int DISMISSED_REASON_ERROR = 5; + + /** + * Dialog dismissal requested by BiometricService. + * @hide + */ + public static final int DISMISSED_REASON_SERVER_REQUESTED = 6; + private static class ButtonInfo { Executor executor; DialogInterface.OnClickListener listener; @@ -362,7 +384,7 @@ public class BiometricPrompt implements BiometricAuthenticator, BiometricConstan @Override public void onDialogDismissed(int reason) throws RemoteException { // Check the reason and invoke OnClickListener(s) if necessary - if (reason == DISMISSED_REASON_POSITIVE) { + if (reason == DISMISSED_REASON_CONFIRMED) { mPositiveButtonInfo.executor.execute(() -> { mPositiveButtonInfo.listener.onClick(null, DialogInterface.BUTTON_POSITIVE); }); diff --git a/core/java/android/hardware/biometrics/IBiometricServiceReceiverInternal.aidl b/core/java/android/hardware/biometrics/IBiometricServiceReceiverInternal.aidl index 180daaf97ada..ca6114e4d842 100644 --- a/core/java/android/hardware/biometrics/IBiometricServiceReceiverInternal.aidl +++ b/core/java/android/hardware/biometrics/IBiometricServiceReceiverInternal.aidl @@ -27,8 +27,8 @@ oneway interface IBiometricServiceReceiverInternal { // Notify BiometricService that authentication was successful. If user confirmation is required, // the auth token must be submitted into KeyStore. void onAuthenticationSucceeded(boolean requireConfirmation, in byte[] token); - // Notify BiometricService that an error has occurred. - void onAuthenticationFailed(int cookie, boolean requireConfirmation); + // Notify BiometricService authentication was rejected. + void onAuthenticationFailed(); // Notify BiometricService than an error has occured. Forward to the correct receiver depending // on the cookie. void onError(int cookie, int error, String message); |
