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

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

static final @NonNull CreateCredentialRequest.DisplayInfo

Returns a RequestDisplayInfo from a CreateCredentialRequest.credentialData Bundle.

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

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

parseFromCredentialDataBundle

Added in 1.3.0-alpha03
@RequiresApi(value = 23)
public static final @NonNull CreateCredentialRequest.DisplayInfo parseFromCredentialDataBundle(@NonNull Bundle from)

Returns a RequestDisplayInfo from a CreateCredentialRequest.credentialData Bundle.

Parameters
@NonNull Bundle from

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