GetCredentialRequest.Builder
public final class GetCredentialRequest.Builder
A builder for GetCredentialRequest.
Summary
Public constructors |
|---|
Builder() |
Public methods |
|
|---|---|
final @NonNull GetCredentialRequest.Builder |
addCredentialOption(@NonNull CredentialOption credentialOption)Adds a specific type of |
final @NonNull GetCredentialRequest |
build()Builds a |
final @NonNull GetCredentialRequest.Builder |
setCredentialOptions(Sets the list of |
final @NonNull GetCredentialRequest.Builder |
Sets the |
final @NonNull GetCredentialRequest.Builder |
setPreferIdentityDocUi(boolean preferIdentityDocUi)Sets the |
final @NonNull GetCredentialRequest.Builder |
setPreferImmediatelyAvailableCredentials(Sets whether you prefer the operation to return immediately when there is no available credentials instead of falling back to discovering remote options. |
final @NonNull GetCredentialRequest.Builder |
setPreferUiBrandingComponentName(ComponentName component)Sets service |
Public methods
addCredentialOption
public final @NonNull GetCredentialRequest.Builder addCredentialOption(@NonNull CredentialOption credentialOption)
Adds a specific type of CredentialOption.
build
public final @NonNull GetCredentialRequest build()
Builds a GetCredentialRequest.
| Throws | |
|---|---|
kotlin.IllegalArgumentException |
If |
setCredentialOptions
public final @NonNull GetCredentialRequest.Builder setCredentialOptions(
@NonNull List<@NonNull CredentialOption> credentialOptions
)
Sets the list of CredentialOption.
setOrigin
public final @NonNull GetCredentialRequest.Builder setOrigin(@NonNull String origin)
Sets the origin of a different application if the request is being made on behalf of that application. For API level >=34, setting a non-null value for this parameter, will throw a SecurityException if android.permission.CREDENTIAL_MANAGER_SET_ORIGIN is not present.
setPreferIdentityDocUi
public final @NonNull GetCredentialRequest.Builder setPreferIdentityDocUi(boolean preferIdentityDocUi)
Sets the Boolean preferIdentityDocUi to true if the requester wants to prefer using a UI suited for Identity Documents like mDocs, Driving License etc.
setPreferImmediatelyAvailableCredentials
public final @NonNull GetCredentialRequest.Builder setPreferImmediatelyAvailableCredentials(
boolean preferImmediatelyAvailableCredentials
)
Sets whether you prefer the operation to return immediately when there is no available credentials instead of falling back to discovering remote options. The default value is false.
setPreferUiBrandingComponentName
public final @NonNull GetCredentialRequest.Builder setPreferUiBrandingComponentName(ComponentName component)
Sets service ComponentName from which the Credential Selector UI will pull its label and icon to render top level branding. Your app must have the permission android.permission.CREDENTIAL_MANAGER_SET_ALLOWED_PROVIDERS to specify this, or it would not take effect. Notice that this bit may not take effect for Android API level 33 and below, depending on the pre-34 provider(s) you have chosen.