CreateEntry.Builder


class CreateEntry.Builder


A builder for CreateEntry

Summary

Public constructors

Builder(accountName: CharSequence, pendingIntent: PendingIntent)

constructs an instance of CreateEntry.Builder

Public functions

CreateEntry

Builds an instance of CreateEntry

CreateEntry.Builder
setAutoSelectAllowed(autoSelectAllowed: Boolean)

Sets whether the entry should be auto-selected.

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

CreateEntry.Builder

Sets a localized description to be displayed on the UI at the time of credential creation.

CreateEntry.Builder
setIcon(icon: Icon?)

Sets an icon to be displayed with the entry on the UI

CreateEntry.Builder
setLastUsedTime(lastUsedTime: Instant?)

Sets the last time this account was used

CreateEntry.Builder

Sets the password credential count, denoting how many credentials of type PasswordCredential.TYPE_PASSWORD_CREDENTIAL does the provider have stored.

CreateEntry.Builder

Sets the password credential count, denoting how many credentials of type PublicKeyCredential.TYPE_PUBLIC_KEY_CREDENTIAL does the provider have stored.

CreateEntry.Builder

Sets the total credential count, denoting how many credentials in total does the provider have stored.

Public constructors

Builder

Added in 1.2.0
Builder(accountName: CharSequence, pendingIntent: PendingIntent)

constructs an instance of CreateEntry.Builder

Parameters
accountName: CharSequence

the name of the account where the credential will be registered

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

Public functions

build

Added in 1.2.0
fun build(): CreateEntry

Builds an instance of CreateEntry

setAutoSelectAllowed

Added in 1.2.0
fun setAutoSelectAllowed(autoSelectAllowed: Boolean): CreateEntry.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?): CreateEntry.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.

setDescription

Added in 1.2.0
fun setDescription(description: CharSequence?): CreateEntry.Builder

Sets a localized description to be displayed on the UI at the time of credential creation.

Typically this description should contain information informing the user of the credential being created, and where it is being stored. Providers are free to phrase this however they see fit.

Throws
kotlin.IllegalArgumentException

if description is longer than 300 characters ( important: make sure your descriptions across all locales are within this limit).

setIcon

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

Sets an icon to be displayed with the entry on the UI

setLastUsedTime

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

Sets the last time this account was used

setPasswordCredentialCount

Added in 1.2.0
fun setPasswordCredentialCount(count: Int): CreateEntry.Builder

Sets the password credential count, denoting how many credentials of type PasswordCredential.TYPE_PASSWORD_CREDENTIAL does the provider have stored.

This information will be displayed on the CreateEntry to help the user make a choice.

setPublicKeyCredentialCount

Added in 1.2.0
fun setPublicKeyCredentialCount(count: Int): CreateEntry.Builder

Sets the password credential count, denoting how many credentials of type PublicKeyCredential.TYPE_PUBLIC_KEY_CREDENTIAL does the provider have stored.

This information will be displayed on the CreateEntry to help the user make a choice.

setTotalCredentialCount

Added in 1.2.0
fun setTotalCredentialCount(count: Int): CreateEntry.Builder

Sets the total credential count, denoting how many credentials in total does the provider have stored.

This total count no. does not need to be a total of the counts set through setPasswordCredentialCount and setPublicKeyCredentialCount.

This information will be displayed on the CreateEntry to help the user make a choice.