summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorKevin Chyn <kchyn@google.com>2019-08-16 20:28:23 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-08-16 20:28:23 +0000
commit04dcb5896ac53b6d835ed652df52015913631a55 (patch)
treef556f937a03c622bad345b10eb1dbe7128c85ae9 /core/java
parent336f7c755d9aef7526db393e4903850a2ea2d607 (diff)
parent27fafb76551cfec876c01cfadfa7f9da6056312e (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')
-rw-r--r--core/java/android/hardware/biometrics/BiometricPrompt.java26
-rw-r--r--core/java/android/hardware/biometrics/IBiometricServiceReceiverInternal.aidl4
-rw-r--r--core/java/com/android/internal/statusbar/IStatusBar.aidl2
-rw-r--r--core/java/com/android/internal/statusbar/IStatusBarService.aidl2
4 files changed, 28 insertions, 6 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);
diff --git a/core/java/com/android/internal/statusbar/IStatusBar.aidl b/core/java/com/android/internal/statusbar/IStatusBar.aidl
index cf0394d466ea..9441825a1ed6 100644
--- a/core/java/com/android/internal/statusbar/IStatusBar.aidl
+++ b/core/java/com/android/internal/statusbar/IStatusBar.aidl
@@ -153,7 +153,7 @@ oneway interface IStatusBar
// Used to show the dialog when BiometricService starts authentication
void showBiometricDialog(in Bundle bundle, IBiometricServiceReceiverInternal receiver, int type,
- boolean requireConfirmation, int userId);
+ boolean requireConfirmation, int userId, String opPackageName);
// Used to hide the dialog when a biometric is authenticated
void onBiometricAuthenticated(boolean authenticated, String failureReason);
// Used to set a temporary message, e.g. fingerprint not recognized, finger moved too fast, etc
diff --git a/core/java/com/android/internal/statusbar/IStatusBarService.aidl b/core/java/com/android/internal/statusbar/IStatusBarService.aidl
index 85ae18e86793..4c3a177a013b 100644
--- a/core/java/com/android/internal/statusbar/IStatusBarService.aidl
+++ b/core/java/com/android/internal/statusbar/IStatusBarService.aidl
@@ -101,7 +101,7 @@ interface IStatusBarService
// Used to show the dialog when BiometricService starts authentication
void showBiometricDialog(in Bundle bundle, IBiometricServiceReceiverInternal receiver, int type,
- boolean requireConfirmation, int userId);
+ boolean requireConfirmation, int userId, String opPackageName);
// Used to hide the dialog when a biometric is authenticated
void onBiometricAuthenticated(boolean authenticated, String failureReason);
// Used to set a temporary message, e.g. fingerprint not recognized, finger moved too fast, etc