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

Builder

class Builder
kotlin.Any
   ↳ androidx.biometric.auth.Class3BiometricAuthPrompt.Builder

Builds a BiometricPrompt object for class 3 biometric only authentication with specified options.

Summary

Public constructors
<init>(@NonNull authPromptHost: AuthPromptHost, @NonNull title: CharSequence, @NonNull negativeButtonText: CharSequence, @NonNull clientExecutor: Executor, @NonNull clientCallback: AuthPromptCallback)

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

<init>(@NonNull authPromptHost: AuthPromptHost, @NonNull title: CharSequence, @NonNull negativeButtonText: CharSequence, @NonNull clientCallback: AuthPromptCallback)

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

Public methods
Class3BiometricAuthPrompt

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

Class3BiometricAuthPrompt.Builder
setConfirmationRequired(confirmationRequired: Boolean)

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

Class3BiometricAuthPrompt.Builder

Required: Sets the crypto object for the prompt authentication.

Class3BiometricAuthPrompt.Builder
setDescription(@NonNull description: CharSequence)

Optional: Sets the description for the prompt.

Class3BiometricAuthPrompt.Builder
setSubtitle(@NonNull subtitle: CharSequence)

Optional: Sets the subtitle for the prompt.

Public constructors

<init>

Builder(
    @NonNull authPromptHost: AuthPromptHost,
    @NonNull title: CharSequence,
    @NonNull negativeButtonText: CharSequence,
    @NonNull clientExecutor: Executor,
    @NonNull clientCallback: AuthPromptCallback)

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 androidx.fragment.app.Fragment or androidx.fragment.app.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.

<init>

Builder(
    @NonNull authPromptHost: AuthPromptHost,
    @NonNull title: CharSequence,
    @NonNull negativeButtonText: CharSequence,
    @NonNull clientCallback: AuthPromptCallback)

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 androidx.fragment.app.Fragment or androidx.fragment.app.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

@NonNull fun build(): Class3BiometricAuthPrompt

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

Return
Class3BiometricAuthPrompt Class3BiometricAuthPrompt instance for starting authentication.

setConfirmationRequired

@NonNull fun setConfirmationRequired(confirmationRequired: Boolean): Class3BiometricAuthPrompt.Builder

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

setCrypto

@NonNull fun setCrypto(@NonNull crypto: BiometricPrompt.CryptoObject): Class3BiometricAuthPrompt.Builder

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.

setDescription

@NonNull fun setDescription(@NonNull description: CharSequence): Class3BiometricAuthPrompt.Builder

Optional: Sets the description for the prompt. Defaults to null.

Parameters
description CharSequence: The description to be displayed on the prompt.
Return
Class3BiometricAuthPrompt.Builder This builder.

setSubtitle

@NonNull fun setSubtitle(@NonNull subtitle: CharSequence): Class3BiometricAuthPrompt.Builder

Optional: Sets the subtitle for the prompt. Defaults to null.

Parameters
subtitle CharSequence: The subtitle to be displayed on the prompt.
Return
Class3BiometricAuthPrompt.Builder This builder.