PrepareGetCredentialResponse
@RequiresApi(value = 34)
public final class PrepareGetCredentialResponse
A response object that indicates the get-credential prefetch work is complete and provides metadata about it. It can then be used to issue the full credential retrieval flow via the CredentialManager.getCredential (Kotlin) / CredentialManager.getCredentialAsync (Java) method to perform the remaining flows such as consent collection and credential selection, to officially retrieve a credential.
For now this API requires Android U (level 34). However, it is designed with backward compatibility in mind and can potentially be made accessible <34 if any provider decides to support that.
This class should be constructed using the Builder (see below) for tests/prod usage.
| Throws | |
|---|---|
kotlin.NullPointerException |
If |
Summary
Nested types |
|---|
@RequiresApi(value = 34)A handle that represents a pending get-credential operation. |
@VisibleForTestingA builder for |
Public methods |
|
|---|---|
final Function1<@NonNull String, @NonNull Boolean> |
whether the response has a credential result handler |
final Function0<@NonNull Boolean> |
whether the response has auth results |
final Function0<@NonNull Boolean> |
whether the response has remote results |
final PrepareGetCredentialResponse.PendingGetCredentialHandle |
a handle that represents this pending get-credential operation; pass this handle to |
final boolean |
@RequiresPermission(value = "android.permission.CREDENTIAL_MANAGER_QUERY_CANDIDATE_CREDENTIALS")Returns true if the user has any candidate authentication actions (locked credential supplier), and false otherwise. |
final boolean |
@RequiresPermission(value = "android.permission.CREDENTIAL_MANAGER_QUERY_CANDIDATE_CREDENTIALS")Returns true if the user has any candidate credentials for the given {@code credentialType}, and false otherwise. |
final boolean |
@RequiresPermission(value = "android.permission.CREDENTIAL_MANAGER_QUERY_CANDIDATE_CREDENTIALS")Returns true if the user has any candidate remote credential results, and false otherwise. |
final boolean |
whether to support null handles for test |
Public methods
getCredentialTypeDelegate
public final Function1<@NonNull String, @NonNull Boolean> getCredentialTypeDelegate()
whether the response has a credential result handler
getHasAuthResultsDelegate
public final Function0<@NonNull Boolean> getHasAuthResultsDelegate()
whether the response has auth results
getHasRemoteResultsDelegate
public final Function0<@NonNull Boolean> getHasRemoteResultsDelegate()
whether the response has remote results
getPendingGetCredentialHandle
public final PrepareGetCredentialResponse.PendingGetCredentialHandle getPendingGetCredentialHandle()
a handle that represents this pending get-credential operation; pass this handle to CredentialManager.getCredential (Kotlin) / CredentialManager.getCredentialAsync (Java) to perform the remaining flows to officially retrieve a credential.
hasAuthenticationResults
@RequiresPermission(value = "android.permission.CREDENTIAL_MANAGER_QUERY_CANDIDATE_CREDENTIALS")
public final boolean hasAuthenticationResults()
Returns true if the user has any candidate authentication actions (locked credential supplier), and false otherwise.
Note: this API will always return false at API level < 34.
hasCredentialResults
@RequiresPermission(value = "android.permission.CREDENTIAL_MANAGER_QUERY_CANDIDATE_CREDENTIALS")
public final boolean hasCredentialResults(@NonNull String credentialType)
Returns true if the user has any candidate credentials for the given {@code credentialType}, and false otherwise.
Note: this API will always return false at API level < 34.
hasRemoteResults
@RequiresPermission(value = "android.permission.CREDENTIAL_MANAGER_QUERY_CANDIDATE_CREDENTIALS")
public final boolean hasRemoteResults()
Returns true if the user has any candidate remote credential results, and false otherwise.
Note: this API will always return false at API level < 34.
isNullHandlesForTest
public final boolean isNullHandlesForTest()
whether to support null handles for test