BackupDeviceAction


public interface BackupDeviceAction

Known direct subclasses
AssertStorageAction

Asserts the correctness of restored test data.

PopulateStorageAction

Populates test data inside the application sandbox before a backup.


Runs an action inside the application sandbox on the target device.

Implementations must provide a public no-arg constructor to enable dynamic instantiation.

Summary

Constants

default static final @NonNull String

Key specifying the SQLite database filename.

default static final @NonNull String

Key containing the error message in BackupDeviceActionResult upon failure.

default static final @NonNull String

Key specifying the expected value in verification.

default static final @NonNull String

Key specifying the column containing the expected value in SQL verification.

default static final @NonNull String

Key specifying the expected column value in SQL verification.

default static final @NonNull String

Key specifying whether to assert that a preference or value is null.

default static final @NonNull String

Key specifying whether a file value is base64-encoded binary data.

default static final @NonNull String

Key specifying whether device-protected storage context should be used.

default static final @NonNull String

Key specifying the primary key column name in SQL query verification.

default static final @NonNull String

Key specifying the primary key column value to filter on in SQL verification.

default static final @NonNull String

Key specifying a relative or absolute file path.

default static final @NonNull String

Key specifying the SharedPreferences preference key.

default static final @NonNull String

Key specifying the SharedPreferences filename.

default static final @NonNull String

Key indicating the execution status in BackupDeviceActionResult.

default static final @NonNull String

Key specifying the target storage medium.

default static final @NonNull String

Key specifying the table name inside the SQLite database.

default static final @NonNull String

Key specifying the value to write or verify.

default static final @NonNull String

Key specifying query or insert key-value pairs formatted as an ampersand-separated string.

default static final @NonNull String

Key specifying the primitive value type for SharedPreferences entries.

default static final int

Seeds data inside the application sandbox before a backup.

default static final int

Verifies restored data inside the application sandbox after a restore.

default static final @NonNull String

Status value indicating failed execution.

default static final @NonNull String

Status value indicating successful execution.

default static final @NonNull String

Storage type value indicating SQLite database.

default static final @NonNull String

Storage type value indicating raw file storage.

default static final @NonNull String

Storage type value indicating SharedPreferences.

Public methods

abstract @NonNull BackupDeviceActionResult

Runs the action payload.

abstract int

Lifecycle phase when this action runs.

Constants

KEY_DB_NAME

Added in 1.0.0-alpha01
default static final @NonNull String KEY_DB_NAME

Key specifying the SQLite database filename.

KEY_ERROR

Added in 1.0.0-alpha01
default static final @NonNull String KEY_ERROR

Key containing the error message in BackupDeviceActionResult upon failure.

Present when KEY_STATUS is STATUS_FAILURE.

KEY_EXPECTED

Added in 1.0.0-alpha01
default static final @NonNull String KEY_EXPECTED

Key specifying the expected value in verification.

KEY_EXPECTED_COL

Added in 1.0.0-alpha01
default static final @NonNull String KEY_EXPECTED_COL

Key specifying the column containing the expected value in SQL verification.

KEY_EXPECTED_VAL

Added in 1.0.0-alpha01
default static final @NonNull String KEY_EXPECTED_VAL

Key specifying the expected column value in SQL verification.

Must be passed as a string representation of the expected column value (e.g., "true" or "false" for SQLite booleans, or string values).

KEY_EXPECT_NULL

Added in 1.0.0-alpha01
default static final @NonNull String KEY_EXPECT_NULL

Key specifying whether to assert that a preference or value is null.

Accepted values are "true" or "false". When "true", verification asserts that the preference key, column, or file does not exist.

KEY_IS_BINARY

Added in 1.0.0-alpha01
default static final @NonNull String KEY_IS_BINARY

Key specifying whether a file value is base64-encoded binary data.

Accepted values are "true" or "false". When "true", file contents are decoded using android.util.Base64.DEFAULT.

KEY_IS_DEVICE_PROTECTED

Added in 1.0.0-alpha01
default static final @NonNull String KEY_IS_DEVICE_PROTECTED

Key specifying whether device-protected storage context should be used.

When set to "true", operations target android.content.Context.createDeviceProtectedStorageContext instead of default credential-encrypted storage. Accepted values are "true" or "false".

KEY_KEY_COL

Added in 1.0.0-alpha01
default static final @NonNull String KEY_KEY_COL

Key specifying the primary key column name in SQL query verification.

KEY_KEY_VAL

Added in 1.0.0-alpha01
default static final @NonNull String KEY_KEY_VAL

Key specifying the primary key column value to filter on in SQL verification.

KEY_PATH

Added in 1.0.0-alpha01
default static final @NonNull String KEY_PATH

Key specifying a relative or absolute file path.

KEY_PREF_KEY

Added in 1.0.0-alpha01
default static final @NonNull String KEY_PREF_KEY

Key specifying the SharedPreferences preference key.

KEY_PREF_NAME

Added in 1.0.0-alpha01
default static final @NonNull String KEY_PREF_NAME

Key specifying the SharedPreferences filename.

KEY_STATUS

Added in 1.0.0-alpha01
default static final @NonNull String KEY_STATUS

Key indicating the execution status in BackupDeviceActionResult.

The returned value will be one of the status constants: STATUS_SUCCESS or STATUS_FAILURE. Since this key tracks non-binary, extensible status categories (e.g., which could include future warnings or partial success info), it is represented as a string rather than a simple boolean.

KEY_STORAGE_TYPE

Added in 1.0.0-alpha01
default static final @NonNull String KEY_STORAGE_TYPE

Key specifying the target storage medium.

Must be set to one of the following storage type constants:

KEY_TABLE

Added in 1.0.0-alpha01
default static final @NonNull String KEY_TABLE

Key specifying the table name inside the SQLite database.

KEY_VALUE

Added in 1.0.0-alpha01
default static final @NonNull String KEY_VALUE

Key specifying the value to write or verify.

KEY_VALUES

Added in 1.0.0-alpha01
default static final @NonNull String KEY_VALUES

Key specifying query or insert key-value pairs formatted as an ampersand-separated string.

For example, "column1=value1&column2=value2".

KEY_VALUE_TYPE

Added in 1.0.0-alpha01
default static final @NonNull String KEY_VALUE_TYPE

Key specifying the primitive value type for SharedPreferences entries.

Must be one of "INT", "LONG", "BOOLEAN", "FLOAT", or "STRING".

PHASE_POPULATE

Added in 1.0.0-alpha01
default static final int PHASE_POPULATE = 1

Seeds data inside the application sandbox before a backup.

PHASE_VERIFY

Added in 1.0.0-alpha01
default static final int PHASE_VERIFY = 2

Verifies restored data inside the application sandbox after a restore.

STATUS_FAILURE

Added in 1.0.0-alpha01
default static final @NonNull String STATUS_FAILURE

Status value indicating failed execution.

STATUS_SUCCESS

Added in 1.0.0-alpha01
default static final @NonNull String STATUS_SUCCESS

Status value indicating successful execution.

STORAGE_TYPE_DATABASE

Added in 1.0.0-alpha01
default static final @NonNull String STORAGE_TYPE_DATABASE

Storage type value indicating SQLite database.

STORAGE_TYPE_FILES

Added in 1.0.0-alpha01
default static final @NonNull String STORAGE_TYPE_FILES

Storage type value indicating raw file storage.

STORAGE_TYPE_PREFS

Added in 1.0.0-alpha01
default static final @NonNull String STORAGE_TYPE_PREFS

Storage type value indicating SharedPreferences.

Public methods

execute

Added in 1.0.0-alpha01
abstract @NonNull BackupDeviceActionResult execute(@NonNull Context context, @NonNull BackupDeviceActionArgs args)

Runs the action payload.

Parameters
@NonNull Context context

application context on the target device

@NonNull BackupDeviceActionArgs args

input arguments passed from the host orchestrator

Returns
@NonNull BackupDeviceActionResult

result returned to the host

getPhase

Added in 1.0.0-alpha01
abstract int getPhase()

Lifecycle phase when this action runs.