O Google tem o compromisso de promover a igualdade racial para as comunidades negras. Saiba como.

Builder

open class Builder
kotlin.Any
   ↳ androidx.biometric.BiometricPrompt.PromptInfo.Builder

A builder used to set individual options for the PromptInfo class.

Summary

Public constructors

A builder used to set individual options for the PromptInfo class.

Public methods
open BiometricPrompt.PromptInfo

Creates a PromptInfo object with the specified options.

open BiometricPrompt.PromptInfo.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

open BiometricPrompt.PromptInfo.Builder
setDescription(@Nullable description: CharSequence?)

Optional: Sets the description for the prompt.

open BiometricPrompt.PromptInfo.Builder
setDeviceCredentialAllowed(deviceCredentialAllowed: Boolean)

Optional: Sets whether the user should be given the option to authenticate with their device PIN, pattern, or password instead of a biometric.

open BiometricPrompt.PromptInfo.Builder
setNegativeButtonText(@NonNull negativeButtonText: CharSequence)

Required: Sets the text for the negative button on the prompt.

open BiometricPrompt.PromptInfo.Builder
setSubtitle(@Nullable subtitle: CharSequence?)

Optional: Sets the subtitle for the prompt.

open BiometricPrompt.PromptInfo.Builder
setTitle(@NonNull title: CharSequence)

Required: Sets the title for the prompt.

Public constructors

<init>

Builder()

A builder used to set individual options for the PromptInfo class.

Public methods

build

@NonNull open fun build(): BiometricPrompt.PromptInfo

Creates a PromptInfo object with the specified options.

Return
BiometricPrompt.PromptInfo The PromptInfo object.
Exceptions
IllegalArgumentException If any required option is not set, or if any illegal combination of options is present.

setConfirmationRequired

@NonNull open fun setConfirmationRequired(confirmationRequired: Boolean): BiometricPrompt.PromptInfo.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 AuthenticationCallback#onAuthenticationSucceeded(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
BiometricPrompt.PromptInfo.Builder This builder.

setDescription

@NonNull open fun setDescription(@Nullable description: CharSequence?): BiometricPrompt.PromptInfo.Builder

Optional: Sets the description for the prompt.

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

setDeviceCredentialAllowed

@NonNull open fun setDeviceCredentialAllowed(deviceCredentialAllowed: Boolean): BiometricPrompt.PromptInfo.Builder

Optional: Sets whether the user should be given the option to authenticate with their device PIN, pattern, or password instead of a biometric. Defaults to false.

Note that this option is incompatible with PromptInfo.Builder#setNegativeButtonText(CharSequence) and must NOT be enabled if the latter is set.

Before enabling this option, developers should check whether the device is secure by calling android.app.KeyguardManager#isDeviceSecure(). If the device is not secure, authentication will fail with ERROR_NO_DEVICE_CREDENTIAL.

On versions prior to Android 10 (API 29), calls to cancelAuthentication() will not work as expected after the user has chosen to authenticate with their device credential. This is because the library internally launches a separate activity (by calling android.app.KeyguardManager#createConfirmDeviceCredentialIntent(CharSequence, * CharSequence)) that does not have a public API for cancellation.

Parameters
deviceCredentialAllowed Boolean: Whether this option should be enabled.
Return
BiometricPrompt.PromptInfo.Builder This builder.

setNegativeButtonText

@NonNull open fun setNegativeButtonText(@NonNull negativeButtonText: CharSequence): BiometricPrompt.PromptInfo.Builder

Required: Sets the text for the negative button on the prompt.

Note that this option is incompatible with PromptInfo.Builder#setDeviceCredentialAllowed(boolean) and must NOT be set if the latter is enabled.

Parameters
negativeButtonText CharSequence: The label to be used for the negative button on the prompt.
Return
BiometricPrompt.PromptInfo.Builder This builder.

setSubtitle

@NonNull open fun setSubtitle(@Nullable subtitle: CharSequence?): BiometricPrompt.PromptInfo.Builder

Optional: Sets the subtitle for the prompt.

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

setTitle

@NonNull open fun setTitle(@NonNull title: CharSequence): BiometricPrompt.PromptInfo.Builder

Required: Sets the title for the prompt.

Parameters
title CharSequence: The title to be displayed on the prompt.
Return
BiometricPrompt.PromptInfo.Builder This builder.