StorageDomain.CustomData


public final class StorageDomain.CustomData extends StorageDomain


Targets data that device actions of your own seed and verify, such as a restore credential that only the app's code can create and read.

The flow runs populateAction with args before the backup. After the restore, it runs verifyAction with args and the data that populateAction returned, except its status and error. That data replaces the values of args with the same keys. The flow fails if either action fails, or if populateAction returns a key that the runner reserves.

Summary

Public constructors

CustomData(
    @NonNull String populateAction,
    @NonNull String verifyAction,
    @NonNull Map<@NonNull String, @NonNull String> args
)

Public methods

boolean
equals(Object other)
final @NonNull Map<@NonNull String, @NonNull String>

arguments for both actions, as BackupRestoreController.runOnDevice takes them.

final @NonNull String

class name of the androidx.test.backup.BackupDeviceAction that seeds the data

final @NonNull String

class name of the androidx.test.backup.BackupDeviceAction that verifies the data after the restore

int
@NonNull String

Public constructors

CustomData

Added in 1.0.0-alpha04
public CustomData(
    @NonNull String populateAction,
    @NonNull String verifyAction,
    @NonNull Map<@NonNull String, @NonNull String> args
)

Public methods

equals

public boolean equals(Object other)

getArgs

Added in 1.0.0-alpha04
public final @NonNull Map<@NonNull String, @NonNull String> getArgs()

arguments for both actions, as BackupRestoreController.runOnDevice takes them. The keys actionClass, argsFile, debug and redirect_dir are reserved for the runner; with one of them, construction fails with an IllegalArgumentException. The domain keeps a copy of it.

getPopulateAction

Added in 1.0.0-alpha04
public final @NonNull String getPopulateAction()

class name of the androidx.test.backup.BackupDeviceAction that seeds the data

getVerifyAction

Added in 1.0.0-alpha04
public final @NonNull String getVerifyAction()

class name of the androidx.test.backup.BackupDeviceAction that verifies the data after the restore

hashCode

public int hashCode()

toString

public @NonNull String toString()