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 |
boolean | hasRemoteResults() Returns true if the user has any candidate remote credential results, and false otherwise. |
Inherited methods | |
|---|---|
Public methods
getPendingGetCredentialHandle
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
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
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
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 | |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2026-02-26 UTC.