PasswordCredentialEntry.Builder


class PasswordCredentialEntry.Builder


Builder for PasswordCredentialEntry

Summary

Public constructors

Builder(
    context: Context,
    username: CharSequence,
    pendingIntent: PendingIntent,
    beginGetPasswordOption: BeginGetPasswordOption
)

constructs an instance of PasswordCredentialEntry.Builder

Public functions

PasswordCredentialEntry

Builds an instance of PasswordCredentialEntry

PasswordCredentialEntry.Builder
setAffiliatedDomain(affiliatedDomain: CharSequence?)

Sets whether the entry should have an affiliated domain, a CharSequence representation of some larger entity that may be used to bind multiple entries together (e.g. app_one, and app_two may be bound by 'super_app' as the larger affiliation domain) without length limit, default null.

PasswordCredentialEntry.Builder
setAutoSelectAllowed(autoSelectAllowed: Boolean)

Sets whether the entry should be auto-selected.

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

PasswordCredentialEntry.Builder
setDefaultIconPreferredAsSingleProvider(
    isDefaultIconPreferredAsSingleProvider: Boolean
)

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

PasswordCredentialEntry.Builder

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

PasswordCredentialEntry.Builder
setIcon(icon: Icon)

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

PasswordCredentialEntry.Builder
setLastUsedTime(lastUsedTime: Instant?)

Sets the last used time of this account.

Public constructors

Builder

Added in 1.2.0
Builder(
    context: Context,
    username: CharSequence,
    pendingIntent: PendingIntent,
    beginGetPasswordOption: BeginGetPasswordOption
)

constructs an instance of PasswordCredentialEntry.Builder

Parameters
context: Context

the context of the calling app, required to retrieve fallback resources

username: CharSequence

the username of the account holding the password credential

pendingIntent: PendingIntent

the PendingIntent that will get invoked when the user selects this entry, must be created with a unique request code per entry, with flag PendingIntent.FLAG_MUTABLE to allow the Android system to attach the final request, and NOT with flag PendingIntent.FLAG_ONE_SHOT as it can be invoked multiple times

beginGetPasswordOption: BeginGetPasswordOption

the option from the original BeginGetCredentialResponse, for which this credential entry is being added

Public functions

build

Added in 1.2.0
fun build(): PasswordCredentialEntry

Builds an instance of PasswordCredentialEntry

setAffiliatedDomain

Added in 1.5.0-beta01
fun setAffiliatedDomain(affiliatedDomain: CharSequence?): PasswordCredentialEntry.Builder

Sets whether the entry should have an affiliated domain, a CharSequence representation of some larger entity that may be used to bind multiple entries together (e.g. app_one, and app_two may be bound by 'super_app' as the larger affiliation domain) without length limit, default null.

setAutoSelectAllowed

Added in 1.2.0
fun setAutoSelectAllowed(autoSelectAllowed: Boolean): PasswordCredentialEntry.Builder

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

setBiometricPromptData

Added in 1.5.0-beta01
@RequiresApi
fun setBiometricPromptData(biometricPromptData: BiometricPromptData?): PasswordCredentialEntry.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.

setDefaultIconPreferredAsSingleProvider

Added in 1.5.0-beta01
fun setDefaultIconPreferredAsSingleProvider(
    isDefaultIconPreferredAsSingleProvider: Boolean
): PasswordCredentialEntry.Builder

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
fun setDisplayName(displayName: CharSequence?): PasswordCredentialEntry.Builder

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

setIcon

Added in 1.2.0
fun setIcon(icon: Icon): PasswordCredentialEntry.Builder

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

setLastUsedTime

Added in 1.2.0
fun setLastUsedTime(lastUsedTime: Instant?): PasswordCredentialEntry.Builder

Sets the last used time of this account. This information will be used to sort the entries on the selector.