CreateCredentialRequest.DisplayInfo


public final class CreateCredentialRequest.DisplayInfo


Information that may be used for display purposes when rendering UIs to collect the user consent and choice.

Summary

Public constructors

DisplayInfo(@NonNull CharSequence userId, CharSequence userDisplayName)

Constructs a DisplayInfo.

DisplayInfo(
    @NonNull CharSequence userId,
    CharSequence userDisplayName,
    String preferDefaultProvider
)

Constructs a DisplayInfo.

Public methods

static final @NonNull CreateCredentialRequest.DisplayInfo
@RequiresApi(value = 23)
createFrom(@NonNull Bundle from)

Returns a RequestDisplayInfo from a CreateCredentialRequest.credentialData Bundle.

final CharSequence

an optional display name in addition to the userId that may be displayed next to the userId during the user consent to help your user better understand the credential being created

final @NonNull CharSequence

the user identifier of the created credential

Public constructors

DisplayInfo

Added in 1.2.0
public DisplayInfo(@NonNull CharSequence userId, CharSequence userDisplayName)

Constructs a DisplayInfo.

Parameters
@NonNull CharSequence userId

the user id of the created credential

CharSequence userDisplayName

an optional display name in addition to the userId that may be displayed next to the userId during the user consent to help your user better understand the credential being created

DisplayInfo

Added in 1.2.0
public DisplayInfo(
    @NonNull CharSequence userId,
    CharSequence userDisplayName,
    String preferDefaultProvider
)

Constructs a DisplayInfo.

Parameters
@NonNull CharSequence userId

the user id of the created credential

CharSequence userDisplayName

an optional display name in addition to the userId that may be displayed next to the userId during the user consent to help your user better understand the credential being created

String preferDefaultProvider

the preferred default provider component name to prioritize in the selection UI flows. Your app must have the permission android.permission.CREDENTIAL_MANAGER_SET_ALLOWED_PROVIDERS to specify this, or it would not take effect. Also this bit may not take effect for Android API level 33 and below, depending on the pre-34 provider(s) you have chosen.

Public methods

createFrom

Added in 1.5.0-beta01
@RequiresApi(value = 23)
public static final @NonNull CreateCredentialRequest.DisplayInfo createFrom(@NonNull Bundle from)

Returns a RequestDisplayInfo from a CreateCredentialRequest.credentialData Bundle.

It is recommended to construct a DisplayInfo by direct constructor calls, instead of using this API. This API should only be used by a small subset of system apps that reconstruct an existing object for user interactions such as collecting consents.

Parameters
@NonNull Bundle from

the raw display data in the Bundle format, retrieved from CreateCredentialRequest.credentialData

getUserDisplayName

Added in 1.2.0
public final CharSequence getUserDisplayName()

an optional display name in addition to the userId that may be displayed next to the userId during the user consent to help your user better understand the credential being created

getUserId

Added in 1.2.0
public final @NonNull CharSequence getUserId()

the user identifier of the created credential