Builder
class Builder
kotlin.Any | |
↳ | android.service.credentials.BeginCreateCredentialResponse.Builder |
A builder for BeginCreateCredentialResponse
Summary
Public constructors | |
---|---|
Builder() |
Public methods | |
---|---|
BeginCreateCredentialResponse.Builder |
addCreateEntry(createEntry: CreateEntry) Adds an entry to the list of create entries to be shown on the UI. |
BeginCreateCredentialResponse |
build() Builds a new instance of |
BeginCreateCredentialResponse.Builder |
setCreateEntries(createEntries: MutableList<CreateEntry!>) Sets the list of create entries to be shown on the UI. |
BeginCreateCredentialResponse.Builder |
setRemoteCreateEntry(remoteCreateEntry: RemoteEntry?) Sets a remote create entry to be shown on the UI. |
Public constructors
Builder
Builder()
Public methods
addCreateEntry
fun addCreateEntry(createEntry: CreateEntry): BeginCreateCredentialResponse.Builder
Adds an entry to the list of create entries to be shown on the UI.
Parameters | |
---|---|
createEntry |
CreateEntry: This value cannot be null . |
Return | |
---|---|
BeginCreateCredentialResponse.Builder |
This value cannot be null . |
Exceptions | |
---|---|
java.lang.NullPointerException |
If createEntry is null. |
build
fun build(): BeginCreateCredentialResponse
Builds a new instance of BeginCreateCredentialResponse
.
Return | |
---|---|
BeginCreateCredentialResponse |
This value cannot be null . |
setCreateEntries
fun setCreateEntries(createEntries: MutableList<CreateEntry!>): BeginCreateCredentialResponse.Builder
Sets the list of create entries to be shown on the UI.
Parameters | |
---|---|
createEntries |
MutableList<CreateEntry!>: This value cannot be null . |
Return | |
---|---|
BeginCreateCredentialResponse.Builder |
This value cannot be null . |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
If createEntries is empty. |
java.lang.NullPointerException |
If createEntries is null, or any of its elements are null. |
setRemoteCreateEntry
fun setRemoteCreateEntry(remoteCreateEntry: 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 CreateEntry
object, the pendingIntent
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 remoteCreateEntry
, the system will invoke the pendingIntent
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 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
.
Requires android.Manifest.permission#PROVIDE_REMOTE_CREDENTIALS
Parameters | |
---|---|
remoteCreateEntry |
RemoteEntry?: This value may be null . |
Return | |
---|---|
BeginCreateCredentialResponse.Builder |
This value cannot be null . |