PrepareGetCredentialResponse


public final class PrepareGetCredentialResponse
extends Object

java.lang.Object
   ↳ android.credentials.PrepareGetCredentialResponse


A response object that prefetches user app credentials and provides metadata about them. It can then be used to issue the full credential retrieval flow via the CredentialManager#getCredential(Context, PendingGetCredentialHandle, CancellationSignal, Executor, OutcomeReceiver) method to perform the remaining flows such as consent collection and credential selection, to officially retrieve a credential.

Summary

Nested classes

class PrepareGetCredentialResponse.PendingGetCredentialHandle

A handle that represents a pending get-credential operation. 

Public methods

PrepareGetCredentialResponse.PendingGetCredentialHandle getPendingGetCredentialHandle()

Returns a handle that represents this pending get-credential operation.

boolean hasAuthenticationResults()

Returns true if the user has any candidate authentication actions (locked credential supplier), and false otherwise.

boolean hasCredentialResults(String credentialType)

Returns true if the user has any candidate credentials for the given credentialType, and false otherwise.

boolean hasRemoteResults()

Returns true if the user has any candidate remote credential results, and false otherwise.

Inherited methods

Public methods

getPendingGetCredentialHandle

Added in API level 34
public PrepareGetCredentialResponse.PendingGetCredentialHandle getPendingGetCredentialHandle ()

Returns a handle that represents this pending get-credential operation. Pass this handle to CredentialManager#getCredential(Context, PendingGetCredentialHandle, CancellationSignal, Executor, OutcomeReceiver) to perform the remaining flows to officially retrieve a credential.

Returns
PrepareGetCredentialResponse.PendingGetCredentialHandle This value cannot be null.

hasAuthenticationResults

Added in API level 34
public boolean hasAuthenticationResults ()

Returns true if the user has any candidate authentication actions (locked credential supplier), and false otherwise.
Requires Manifest.permission.CREDENTIAL_MANAGER_QUERY_CANDIDATE_CREDENTIALS

Returns
boolean

hasCredentialResults

Added in API level 34
public boolean hasCredentialResults (String credentialType)

Returns true if the user has any candidate credentials for the given credentialType, and false otherwise.
Requires Manifest.permission.CREDENTIAL_MANAGER_QUERY_CANDIDATE_CREDENTIALS

Parameters
credentialType String: This value cannot be null.

Returns
boolean

hasRemoteResults

Added in API level 34
public boolean hasRemoteResults ()

Returns true if the user has any candidate remote credential results, and false otherwise.
Requires Manifest.permission.CREDENTIAL_MANAGER_QUERY_CANDIDATE_CREDENTIALS

Returns
boolean