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

Class3BiometricOrCredentialAuthPrompt.Builder

public static final class Class3BiometricOrCredentialAuthPrompt.Builder
extends Object

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


Builder to configure a BiometricPrompt object for class 3 biometric or device credential authentication with specified options.

Summary

Public constructors

Builder(AuthPromptHost authPromptHost, CharSequence title, Executor clientExecutor, AuthPromptCallback clientCallback)

A builder used to set individual options for the Class3BiometricOrCredentialAuthPrompt class to construct a BiometricPrompt for class 3 biometric or device credential authentication.

Builder(AuthPromptHost authPromptHost, CharSequence title, AuthPromptCallback clientCallback)

A builder used to set individual options for the Class3BiometricOrCredentialAuthPrompt class to construct a BiometricPrompt for class 3 biometric or device credential authentication.

Public methods

Class3BiometricOrCredentialAuthPrompt build()

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

Class3BiometricOrCredentialAuthPrompt.Builder setConfirmationRequired(boolean confirmationRequired)

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

Class3BiometricOrCredentialAuthPrompt.Builder setCrypto(BiometricPrompt.CryptoObject crypto)

Optional: Sets the crypto object for the prompt.

Class3BiometricOrCredentialAuthPrompt.Builder setDescription(CharSequence description)

Optional: Sets the description for the prompt.

Class3BiometricOrCredentialAuthPrompt.Builder setSubtitle(CharSequence subtitle)

Optional: Sets the subtitle for the prompt.

Inherited methods

Public constructors

Builder

public Builder (AuthPromptHost authPromptHost, 
                CharSequence title, 
                Executor clientExecutor, 
                AuthPromptCallback clientCallback)

A builder used to set individual options for the Class3BiometricOrCredentialAuthPrompt class to construct a BiometricPrompt for class 3 biometric or device credential authentication.

Parameters
authPromptHost AuthPromptHost: Fragment or FragmentActivity to host the authentication prompt

title CharSequence: The title to be displayed 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, 
                AuthPromptCallback clientCallback)

A builder used to set individual options for the Class3BiometricOrCredentialAuthPrompt class to construct a BiometricPrompt for class 3 biometric or device credential authentication. Sets mClientExecutor to new DefaultExecutor() object.

Parameters
authPromptHost AuthPromptHost: Fragment or FragmentActivity to host the authentication prompt

title CharSequence: The title to be displayed on the prompt.

clientCallback AuthPromptCallback: The object that will receive and process authentication events.

Public methods

build

public Class3BiometricOrCredentialAuthPrompt build ()

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

Returns
Class3BiometricOrCredentialAuthPrompt Class3BiometricOrCredentialAuthPrompt instance for starting authentication.

setConfirmationRequired

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

setCrypto

public Class3BiometricOrCredentialAuthPrompt.Builder setCrypto (BiometricPrompt.CryptoObject crypto)

Optional: Sets the crypto object for the prompt.

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

Returns
Class3BiometricOrCredentialAuthPrompt.Builder

setDescription

public Class3BiometricOrCredentialAuthPrompt.Builder setDescription (CharSequence description)

Optional: Sets the description for the prompt.

Parameters
description CharSequence: The description to be displayed on the prompt.

Returns
Class3BiometricOrCredentialAuthPrompt.Builder This builder.

setSubtitle

public Class3BiometricOrCredentialAuthPrompt.Builder setSubtitle (CharSequence subtitle)

Optional: Sets the subtitle for the prompt.

Parameters
subtitle CharSequence: The subtitle to be displayed on the prompt.

Returns
Class3BiometricOrCredentialAuthPrompt.Builder This builder.