CreateRestoreCredentialRequest
public final class CreateRestoreCredentialRequest extends CreateCredentialRequest
| java.lang.Object | ||
| ↳ | androidx.credentials.CreateCredentialRequest | |
| ↳ | androidx.credentials.CreateRestoreCredentialRequest |
A request to create a restore credential used for app restore purpose. App restore feature is a feature that allows users to copy an app and its data to a new Android device.
If the isCloudBackupEnabled is true, the restore credential service will periodically backup the restore credential to cloud. In order to use this setting, the user device must enable backup and have end-to-end-encryption enabled, such as screen lock. More about cloud backup can be found here. Cloud backup is supported on Android 2.2 and above. If the cloud backup is not enabled, catch the E2eeUnavailableException and retry without cloud backup.
| Throws | |
|---|---|
androidx.credentials.exceptions.restorecredential.E2eeUnavailableException |
if |
androidx.credentials.exceptions.restorecredential.CreateRestoreCredentialDomException |
if the requestJson is an invalid Json that does not follow the standard webauthn web json format |
kotlin.IllegalArgumentException |
If |
Summary
Public constructors |
|---|
CreateRestoreCredentialRequest( |
Public methods |
|
|---|---|
final @NonNull String |
the request in JSON format in the standard webauthn web json. |
final boolean |
whether the credential should be backed up to cloud. |
Inherited methods |
||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Public constructors
CreateRestoreCredentialRequest
public CreateRestoreCredentialRequest(
@NonNull String requestJson,
boolean isCloudBackupEnabled
)
| Parameters | |
|---|---|
@NonNull String requestJson |
the request in JSON format in the standard webauthn web json. |
boolean isCloudBackupEnabled |
whether the credential should be backed up to cloud. |
Public methods
getRequestJson
public final @NonNull String getRequestJson()
the request in JSON format in the standard webauthn web json.
isCloudBackupEnabled
public final boolean isCloudBackupEnabled()
whether the credential should be backed up to cloud.