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(Constructs a |
Public methods |
|
|---|---|
static final @NonNull CreateCredentialRequest.DisplayInfo |
@RequiresApi(value = 23)Returns a RequestDisplayInfo from a |
final CharSequence |
an optional display name in addition to the |
final @NonNull CharSequence |
the user identifier of the created credential |
Public constructors
DisplayInfo
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 |
| Throws | |
|---|---|
kotlin.IllegalArgumentException |
If |
DisplayInfo
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 |
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. |
| Throws | |
|---|---|
kotlin.IllegalArgumentException |
If |
Public methods
createFrom
@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 |
getUserDisplayName
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
public final @NonNull CharSequence getUserId()
the user identifier of the created credential