BeginCreateCredentialResponse.Builder


class BeginCreateCredentialResponse.Builder


Builder for BeginCreateCredentialResponse.

Summary

Public constructors

Public functions

BeginCreateCredentialResponse.Builder

Adds an entry to the list of create entries to be shown on the UI.

BeginCreateCredentialResponse

Builds a new instance of BeginCreateCredentialResponse.

BeginCreateCredentialResponse.Builder

Sets the list of create entries to be shown on the UI.

BeginCreateCredentialResponse.Builder
setRemoteEntry(remoteEntry: RemoteEntry?)

Sets a remote create entry to be shown on the UI.

Public constructors

Builder

Added in 1.2.0
Builder()

Public functions

addCreateEntry

Added in 1.2.0
fun addCreateEntry(createEntry: CreateEntry): BeginCreateCredentialResponse.Builder

Adds an entry to the list of create entries to be shown on the UI.

build

Added in 1.2.0
fun build(): BeginCreateCredentialResponse

Builds a new instance of BeginCreateCredentialResponse.

setCreateEntries

Added in 1.2.0
fun setCreateEntries(createEntries: List<CreateEntry>): BeginCreateCredentialResponse.Builder

Sets the list of create entries to be shown on the UI.

Throws
kotlin.IllegalArgumentException

If createEntries is empty.

kotlin.NullPointerException

If createEntries is null, or any of its elements are null.

setRemoteEntry

Added in 1.2.0
fun setRemoteEntry(remoteEntry: RemoteEntry?): BeginCreateCredentialResponse.Builder

Sets a remote create entry to be shown on the UI. Provider must set this entry if they wish to create the credential on a different device.

When constructing the {@link CreateEntry] object, the pending intent must be set such that it leads to an activity that can provide UI to fulfill the request on a remote device. When user selects this [remoteEntry], the system will invoke the pending intent set on the [CreateEntry].

Once the remote credential flow is complete, the [android.app.Activity] result should be set to [android.app.Activity#RESULT_OK] and an extra with the [CredentialProviderService#EXTRA_CREATE_CREDENTIAL_RESPONSE] key should be populated with a [android.credentials.CreateCredentialResponse] object.

Note that as a provider service you will only be able to set a remote entry if : - Provider service possesses the [android.Manifest.permission.PROVIDE_REMOTE_CREDENTIALS] permission. - Provider service is configured as the provider that can provide remote entries.

If the above conditions are not met, setting back BeginCreateCredentialResponse on the callback from CredentialProviderService#onBeginCreateCredential will throw a SecurityException.