Class2BiometricAuthPrompt.Builder
public
static
final
class
Class2BiometricAuthPrompt.Builder
extends Object
java.lang.Object | |
↳ | androidx.biometric.auth.Class2BiometricAuthPrompt.Builder |
Builds a BiometricPrompt
object for Class 2 biometric only authentication with
specified options.
Summary
Public constructors | |
---|---|
Builder(AuthPromptHost authPromptHost, CharSequence title, CharSequence negativeButtonText, Executor clientExecutor, AuthPromptCallback clientCallback)
A builder used to set individual options for the |
|
Builder(AuthPromptHost authPromptHost, CharSequence title, CharSequence negativeButtonText, AuthPromptCallback clientCallback)
A builder used to set individual options for the |
Public methods | |
---|---|
Class2BiometricAuthPrompt
|
build()
Configures a |
Class2BiometricAuthPrompt.Builder
|
setConfirmationRequired(boolean confirmationRequired)
Optional: Sets a system hint for whether to require explicit user confirmation after a passive biometric (e.g. |
Class2BiometricAuthPrompt.Builder
|
setDescription(CharSequence description)
Optional: Sets the description for the prompt. |
Class2BiometricAuthPrompt.Builder
|
setSubtitle(CharSequence subtitle)
Optional: Sets the subtitle for the prompt. |
Inherited methods | |
---|---|
Public constructors
Builder
public Builder (AuthPromptHost authPromptHost, CharSequence title, CharSequence negativeButtonText, Executor clientExecutor, AuthPromptCallback clientCallback)
A builder used to set individual options for the Class2BiometricAuthPrompt
class to construct a BiometricPrompt
for class 2 biometric only authentication.
Parameters | |
---|---|
authPromptHost |
AuthPromptHost : Contains Fragment or
FragmentActivity to host the authentication prompt |
title |
CharSequence : The title to be displayed on the prompt. |
negativeButtonText |
CharSequence : The label to be used for the negative button on the prompt. |
clientExecutor |
Executor : The executor that will run authentication callback methods. |
clientCallback |
AuthPromptCallback : The object that will receive and process authentication events.
|
Builder
public Builder (AuthPromptHost authPromptHost, CharSequence title, CharSequence negativeButtonText, AuthPromptCallback clientCallback)
A builder used to set individual options for the Class2BiometricAuthPrompt
class to construct a BiometricPrompt
for class 2 biometric only authentication.
Sets mClientExecutor to new DefaultExecutor() object.
Parameters | |
---|---|
authPromptHost |
AuthPromptHost : Contains Fragment or
FragmentActivity to host the authentication prompt |
title |
CharSequence : The title to be displayed on the prompt. |
negativeButtonText |
CharSequence : The label to be used for the negative button on the prompt. |
clientCallback |
AuthPromptCallback : The object that will receive and process authentication events.
|
Public methods
build
public Class2BiometricAuthPrompt build ()
Configures a BiometricPrompt
object with the specified options, and returns a
Class2BiometricAuthPrompt
instance that can be used for starting authentication.
Returns | |
---|---|
Class2BiometricAuthPrompt |
Class2BiometricAuthPrompt instance for starting authentication.
|
setConfirmationRequired
public Class2BiometricAuthPrompt.Builder setConfirmationRequired (boolean confirmationRequired)
Optional: Sets a system hint for whether to require explicit user confirmation after a
passive biometric (e.g. iris or face) has been recognized but before AuthPromptCallback.onAuthenticationSucceeded(androidx.fragment.app.FragmentActivity, BiometricPrompt.AuthenticationResult)
is called. Defaults to true
.
Disabling this option is generally only appropriate for frequent, low-value transactions, such as re-authenticating for a previously authorized application.
Also note that, as it is merely a hint, this option may be ignored by the system. For example, the system may choose to instead always require confirmation if the user has disabled passive authentication for their device in Settings. Additionally, this option will be ignored on devices running OS versions prior to Android 10 (API 29).
Parameters | |
---|---|
confirmationRequired |
boolean : Whether this option should be enabled. |
Returns | |
---|---|
Class2BiometricAuthPrompt.Builder |
This builder. |
setDescription
public Class2BiometricAuthPrompt.Builder setDescription (CharSequence description)
Optional: Sets the description for the prompt. Defaults to null.
Parameters | |
---|---|
description |
CharSequence : The description to be displayed on the prompt. |
Returns | |
---|---|
Class2BiometricAuthPrompt.Builder |
This builder. |
setSubtitle
public Class2BiometricAuthPrompt.Builder setSubtitle (CharSequence subtitle)
Optional: Sets the subtitle for the prompt. Defaults to null.
Parameters | |
---|---|
subtitle |
CharSequence : The subtitle to be displayed on the prompt. |
Returns | |
---|---|
Class2BiometricAuthPrompt.Builder |
This builder. |