PublicKeyCredentialEntry.Builder


public final class PublicKeyCredentialEntry.Builder


Builder for PublicKeyCredentialEntry

Summary

Public constructors

Builder(
    @NonNull Context context,
    @NonNull CharSequence username,
    @NonNull PendingIntent pendingIntent,
    @NonNull BeginGetPublicKeyCredentialOption beginGetPublicKeyCredentialOption
)

Public methods

final @NonNull PublicKeyCredentialEntry

Builds an instance of PublicKeyCredentialEntry

final @NonNull PublicKeyCredentialEntry.Builder
setAutoSelectAllowed(boolean autoSelectAllowed)

Sets whether the entry should be auto-selected.

final @NonNull PublicKeyCredentialEntry.Builder

Sets the biometric prompt data to optionally utilize a credential manager flow that directly handles the biometric verification for you and gives you the response; set to null by default, indicating the default behavior is to not utilize this embedded biometric prompt flow.

final @NonNull PublicKeyCredentialEntry.Builder
setDefaultIconPreferredAsSingleProvider(
    boolean isDefaultIconPreferredAsSingleProvider
)

When set to true, the UI prefers to render the default credential type icon when you are the single available provider; false by default.

final @NonNull PublicKeyCredentialEntry.Builder

Sets a displayName to be shown on the UI with this entry

final @NonNull PublicKeyCredentialEntry.Builder

Sets the icon to be shown on the UI with this entry

final @NonNull PublicKeyCredentialEntry.Builder
setLastUsedTime(Instant lastUsedTime)

Sets the last used time of this account

Public constructors

Builder

Added in 1.2.0
public Builder(
    @NonNull Context context,
    @NonNull CharSequence username,
    @NonNull PendingIntent pendingIntent,
    @NonNull BeginGetPublicKeyCredentialOption beginGetPublicKeyCredentialOption
)

Public methods

build

Added in 1.2.0
public final @NonNull PublicKeyCredentialEntry build()

Builds an instance of PublicKeyCredentialEntry

setAutoSelectAllowed

Added in 1.2.0
public final @NonNull PublicKeyCredentialEntry.Builder setAutoSelectAllowed(boolean autoSelectAllowed)

Sets whether the entry should be auto-selected. The value is false by default

setBiometricPromptData

Added in 1.5.0-beta01
@RequiresApi
public final @NonNull PublicKeyCredentialEntry.Builder setBiometricPromptData(BiometricPromptData biometricPromptData)

Sets the biometric prompt data to optionally utilize a credential manager flow that directly handles the biometric verification for you and gives you the response; set to null by default, indicating the default behavior is to not utilize this embedded biometric prompt flow.

setDefaultIconPreferredAsSingleProvider

Added in 1.5.0-beta01
public final @NonNull PublicKeyCredentialEntry.Builder setDefaultIconPreferredAsSingleProvider(
    boolean isDefaultIconPreferredAsSingleProvider
)

When set to true, the UI prefers to render the default credential type icon when you are the single available provider; false by default.

setDisplayName

Added in 1.2.0
public final @NonNull PublicKeyCredentialEntry.Builder setDisplayName(CharSequence displayName)

Sets a displayName to be shown on the UI with this entry

setIcon

Added in 1.2.0
public final @NonNull PublicKeyCredentialEntry.Builder setIcon(@NonNull Icon icon)

Sets the icon to be shown on the UI with this entry

setLastUsedTime

Added in 1.2.0
public final @NonNull PublicKeyCredentialEntry.Builder setLastUsedTime(Instant lastUsedTime)

Sets the last used time of this account

This information will be used to sort the entries on the selector.