CreateEntry.Builder


public final class CreateEntry.Builder


A builder for CreateEntry

Summary

Public constructors

Builder(
    @NonNull CharSequence accountName,
    @NonNull PendingIntent pendingIntent
)

constructs an instance of CreateEntry.Builder

Public methods

final @NonNull CreateEntry

Builds an instance of CreateEntry

final @NonNull CreateEntry.Builder
setAutoSelectAllowed(boolean autoSelectAllowed)

Sets whether the entry should be auto-selected.

final @NonNull CreateEntry.Builder

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

final @NonNull CreateEntry.Builder
setIcon(Icon icon)

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

final @NonNull CreateEntry.Builder
setLastUsedTime(Instant lastUsedTime)

Sets the last time this account was used

final @NonNull CreateEntry.Builder

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

final @NonNull CreateEntry.Builder

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

final @NonNull 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
public Builder(
    @NonNull CharSequence accountName,
    @NonNull PendingIntent pendingIntent
)

constructs an instance of CreateEntry.Builder

Parameters
@NonNull CharSequence accountName

the name of the account where the credential will be registered

@NonNull 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 methods

build

Added in 1.2.0
public final @NonNull CreateEntry build()

Builds an instance of CreateEntry

setAutoSelectAllowed

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

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

setDescription

Added in 1.2.0
public final @NonNull CreateEntry.Builder setDescription(CharSequence description)

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
public final @NonNull CreateEntry.Builder setIcon(Icon icon)

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

setLastUsedTime

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

Sets the last time this account was used

setPasswordCredentialCount

Added in 1.2.0
public final @NonNull CreateEntry.Builder setPasswordCredentialCount(int count)

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
public final @NonNull CreateEntry.Builder setPublicKeyCredentialCount(int count)

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
public final @NonNull CreateEntry.Builder setTotalCredentialCount(int count)

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.