Added in API level 34

Builder


class Builder
kotlin.Any
   ↳ android.credentials.CredentialOption.Builder

A builder for CredentialOption.

Summary

Public constructors
Builder(type: String, credentialRetrievalData: Bundle, candidateQueryData: Bundle)

Public methods
CredentialOption.Builder

Adds a provider ComponentName to be queried while gathering credentials from credential providers on the device.

CredentialOption

Builds a CredentialOption.

CredentialOption.Builder

Sets a set of provider ComponentName to be queried while gathering credentials from credential providers on the device.

CredentialOption.Builder
setIsSystemProviderRequired(isSystemProviderRequired: Boolean)

Sets a true/false value corresponding to whether this option must be serviced by system credentials providers only.

Public constructors

Builder

Added in API level 34
Builder(
    type: String,
    credentialRetrievalData: Bundle,
    candidateQueryData: Bundle)
Parameters
type String: the type of the credential option This value cannot be null.
credentialRetrievalData Bundle: the full request data This value cannot be null.
candidateQueryData Bundle: the partial request data that will be sent to the provider during the initial credential candidate query stage. This value cannot be null.
Exceptions
java.lang.IllegalArgumentException If type is null, or empty
java.lang.NullPointerException If credentialRetrievalData, or candidateQueryData is null

Public methods

addAllowedProvider

Added in API level 34
fun addAllowedProvider(allowedProvider: ComponentName): CredentialOption.Builder

Adds a provider ComponentName to be queried while gathering credentials from credential providers on the device. If no candidate providers are specified, all user configured and system credential providers will be queried in the candidate query phase. If an invalid component name is provided, or a service corresponding to the component name does not exist on the device, that component name is ignored. If all component names are invalid, or not present on the device, no providers are queried and no credentials are retrieved.

Parameters
allowedProvider ComponentName: This value cannot be null.
Return
CredentialOption.Builder This value cannot be null.
Exceptions
java.lang.NullPointerException If allowedProvider is null

build

Added in API level 34
fun build(): CredentialOption

Builds a CredentialOption.

Return
CredentialOption This value cannot be null.

setAllowedProviders

Added in API level 34
fun setAllowedProviders(allowedProviders: MutableSet<ComponentName!>): CredentialOption.Builder

Sets a set of provider ComponentName to be queried while gathering credentials from credential providers on the device. If no candidate providers are specified, all user configured and system credential providers will be queried in the candidate query phase. If an invalid component name is provided, or a service corresponding to the component name does not exist on the device, that component name is ignored. If all component names are invalid, or not present on the device, no providers are queried and no credentials are retrieved.

Parameters
allowedProviders MutableSet<ComponentName!>: This value cannot be null.
Return
CredentialOption.Builder This value cannot be null.
Exceptions
java.lang.NullPointerException If allowedProviders is null, or any of its elements are null.

setIsSystemProviderRequired

Added in API level 34
fun setIsSystemProviderRequired(isSystemProviderRequired: Boolean): CredentialOption.Builder

Sets a true/false value corresponding to whether this option must be serviced by system credentials providers only.

Return
CredentialOption.Builder This value cannot be null.