Google is committed to advancing racial equity for Black communities. See how.

Class3BiometricAuthPrompt.Builder

public static final class Class3BiometricAuthPrompt.Builder
extends Object

java.lang.Object
   ↳ androidx.biometric.auth.Class3BiometricAuthPrompt.Builder


Builds a BiometricPrompt object for class 3 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 Class3BiometricAuthPrompt class to construct a BiometricPrompt for class 3 biometric only authentication.

Builder(AuthPromptHost authPromptHost, CharSequence title, CharSequence negativeButtonText, AuthPromptCallback clientCallback)

A builder used to set individual options for the Class3BiometricAuthPrompt class to construct a BiometricPrompt for class 3 biometric only authentication.

Public methods

Class3BiometricAuthPrompt build()

Configures a BiometricPrompt object with the specified options, and returns a Class3BiometricAuthPrompt instance that can be used for starting authentication.

Class3BiometricAuthPrompt.Builder setConfirmationRequired(boolean confirmationRequired)

Optional: Sets a system hint for whether to require explicit user confirmation after a passive biometric (e.g.

Class3BiometricAuthPrompt.Builder setCrypto(BiometricPrompt.CryptoObject crypto)

Required: Sets the crypto object for the prompt authentication.

Class3BiometricAuthPrompt.Builder setDescription(CharSequence description)

Optional: Sets the description for the prompt.

Class3BiometricAuthPrompt.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 Class3BiometricAuthPrompt class to construct a BiometricPrompt for class 3 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 Class3BiometricAuthPrompt class to construct a BiometricPrompt for class 3 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 Class3BiometricAuthPrompt build ()

Configures a BiometricPrompt object with the specified options, and returns a Class3BiometricAuthPrompt instance that can be used for starting authentication.

Returns
Class3BiometricAuthPrompt Class3BiometricAuthPrompt instance for starting authentication.

setConfirmationRequired

public Class3BiometricAuthPrompt.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
Class3BiometricAuthPrompt.Builder This builder.

setCrypto

public Class3BiometricAuthPrompt.Builder setCrypto (BiometricPrompt.CryptoObject crypto)

Required: Sets the crypto object for the prompt authentication. Defaults to null.

Parameters
crypto BiometricPrompt.CryptoObject: A crypto object to be associated with this authentication.

Returns
Class3BiometricAuthPrompt.Builder

setDescription

public Class3BiometricAuthPrompt.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
Class3BiometricAuthPrompt.Builder This builder.

setSubtitle

public Class3BiometricAuthPrompt.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
Class3BiometricAuthPrompt.Builder This builder.