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

Builder

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

Builds a BiometricPrompt object for class 2 biometric or device credential authentication with specified options.

Summary

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

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

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

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

Public methods
Class2BiometricOrCredentialAuthPrompt

Configures a BiometricPrompt object with the specified options, and returns a Class2BiometricOrCredentialAuthPrompt instance that can be used to start authentication.

Class2BiometricOrCredentialAuthPrompt.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

Class2BiometricOrCredentialAuthPrompt.Builder
setDescription(@NonNull description: CharSequence)

Optional: Sets the description for the prompt.

Class2BiometricOrCredentialAuthPrompt.Builder
setSubtitle(@NonNull subtitle: CharSequence)

Optional: Sets the subtitle for the prompt.

Public constructors

<init>

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

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

Parameters
authPromptHost AuthPromptHost: androidx.fragment.app.Fragment or androidx.fragment.app.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.

<init>

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

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

Parameters
authPromptHost AuthPromptHost: androidx.fragment.app.Fragment or androidx.fragment.app.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

@NonNull fun build(): Class2BiometricOrCredentialAuthPrompt

Configures a BiometricPrompt object with the specified options, and returns a Class2BiometricOrCredentialAuthPrompt instance that can be used to start authentication.

Return
Class2BiometricOrCredentialAuthPrompt Class2BiometricOrCredentialAuthPrompt instance for starting authentication.

setConfirmationRequired

@NonNull fun setConfirmationRequired(confirmationRequired: Boolean): Class2BiometricOrCredentialAuthPrompt.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
Class2BiometricOrCredentialAuthPrompt.Builder This builder.

setDescription

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

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

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

setSubtitle

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

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

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