diff options
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/hardware/biometrics/BiometricPrompt.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/core/java/android/hardware/biometrics/BiometricPrompt.java b/core/java/android/hardware/biometrics/BiometricPrompt.java index b238d778f55a..f652f85c153b 100644 --- a/core/java/android/hardware/biometrics/BiometricPrompt.java +++ b/core/java/android/hardware/biometrics/BiometricPrompt.java @@ -73,6 +73,10 @@ public class BiometricPrompt implements BiometricAuthenticator, BiometricConstan * @hide */ public static final String KEY_NEGATIVE_TEXT = "negative_text"; + /** + * @hide + */ + public static final String KEY_REQUIRE_CONFIRMATION = "require_confirmation"; /** * Error/help message will show for this amount of time. @@ -215,6 +219,30 @@ public class BiometricPrompt implements BiometricAuthenticator, BiometricConstan } /** + * Optional: A hint to the system to require user confirmation after a biometric has been + * authenticated. For example, implicit modalities like Face and Iris authentication are + * passive, meaning they don't require an explicit user action to complete. When set to + * 'false', the user action (e.g. pressing a button) will not be required. BiometricPrompt + * will require confirmation by default. + * + * A typical use case for not requiring confirmation would be for low-risk transactions, + * such as re-authenticating a recently authenticated application. A typical use case for + * requiring confirmation would be for authorizing a purchase. + * + * Note that this is a hint to the system. The system may choose to ignore the flag. For + * example, if the user disables implicit authentication in Settings, or if it does not + * apply to a modality (e.g. Fingerprint). When ignored, the system will default to + * requiring confirmation. + * + * @param requireConfirmation + * @hide + */ + public Builder setRequireConfirmation(boolean requireConfirmation) { + mBundle.putBoolean(KEY_REQUIRE_CONFIRMATION, requireConfirmation); + return this; + } + + /** * Creates a {@link BiometricPrompt}. * @return a {@link BiometricPrompt} * @throws IllegalArgumentException if any of the required fields are not set. |
