Stay organized with collections Save and categorize content based on your preferences.

CreateEntry

@RequiresApi(value = 34)
public final class CreateEntry extends CreateEntry


An entry to be shown on the selector during a create flow initiated when an app calls CredentialManager.createCredential

A CreateEntry points to a location such as an account, or a group where the credential can be registered. When user selects this entry, the corresponding PendingIntent is fired, and the credential creation can be completed.

Throws
kotlin.IllegalArgumentException kotlin.IllegalArgumentException

If accountName is empty

Summary

Nested types

public final class CreateEntry.Builder

A builder for CreateEntry

public static class CreateEntry.Companion

Public fields

static final @NonNull Parcelable.Creator<@NonNull CreateEntry>

Public constructors

CreateEntry(
    @NonNull CharSequence accountName,
    @NonNull PendingIntent pendingIntent,
    CharSequence description,
    Instant lastUsedTime,
    Icon icon,
    Integer passwordCredentialCount,
    Integer publicKeyCredentialCount,
    Integer totalCredentialCount
)

Creates an entry to be displayed on the selector during create flows.

Public methods

int
final @NonNull CharSequence
final CharSequence
final Icon
final Instant
final Integer

Returns the no. of password type credentials that the provider with this entry has.

final @NonNull PendingIntent
final Integer

Returns the no. of public key type credentials that the provider with this entry has.

final Integer

Returns the no. of total credentials that the provider with this entry has.

void
writeToParcel(@NonNull Parcel dest, int flags)

Public fields

CREATOR

public static final @NonNull Parcelable.Creator<@NonNull CreateEntryCREATOR

Public constructors

CreateEntry

public CreateEntry(
    @NonNull CharSequence accountName,
    @NonNull PendingIntent pendingIntent,
    CharSequence description,
    Instant lastUsedTime,
    Icon icon,
    Integer passwordCredentialCount,
    Integer publicKeyCredentialCount,
    Integer totalCredentialCount
)

Creates an entry to be displayed on the selector during create flows.

Parameters
@NonNull CharSequence accountName

the name of the account where the credential will be saved

@NonNull PendingIntent pendingIntent

the PendingIntent that will get invoked when user selects this entry

CharSequence description

the localized description shown on UI about where the credential is stored

Instant lastUsedTime

the last time the account underlying this entry was used by the user

Icon icon

the icon to be displayed with this entry on the UI

Integer passwordCredentialCount

the no. of password credentials saved by the provider

Integer publicKeyCredentialCount

the no. of public key credentials saved by the provider

Integer totalCredentialCount

the total no. of credentials saved by the provider

Throws
kotlin.IllegalArgumentException kotlin.IllegalArgumentException

If accountName is empty, or if description is longer than 300 characters (important: make sure your descriptions across all locales are within this limit)

kotlin.NullPointerException kotlin.NullPointerException

If accountName or pendingIntent is null

Public methods

describeContents

public int describeContents()

getAccountName

public final @NonNull CharSequence getAccountName()

getDescription

public final CharSequence getDescription()

getIcon

public final Icon getIcon()

getLastUsedTime

public final Instant getLastUsedTime()

getPasswordCredentialCount

public final Integer getPasswordCredentialCount()

Returns the no. of password type credentials that the provider with this entry has.

getPendingIntent

public final @NonNull PendingIntent getPendingIntent()

getPublicKeyCredentialCount

public final Integer getPublicKeyCredentialCount()

Returns the no. of public key type credentials that the provider with this entry has.

getTotalCredentialCount

public final Integer getTotalCredentialCount()

Returns the no. of total credentials that the provider with this entry has.

This total count is not necessarily equal to the sum of getPasswordCredentialCount and getPublicKeyCredentialCount.

writeToParcel

public void writeToParcel(@NonNull Parcel dest, int flags)