BackupDeviceAction


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

const String

Key specifying the SQLite database filename.

const String

Key containing the error message in BackupDeviceActionResult upon failure.

const String

Key specifying the expected value in verification.

const String

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

const String

Key specifying the expected column value in SQL verification.

const String

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

const String

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

const String

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

const String

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

const String

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

const String

Key specifying a relative or absolute file path.

const String

Key specifying the SharedPreferences preference key.

const String

Key specifying the SharedPreferences filename.

const String

Key indicating the execution status in BackupDeviceActionResult.

const String

Key specifying the target storage medium.

const String

Key specifying the table name inside the SQLite database.

const String

Key specifying the value to write or verify.

const String

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

const String

Key specifying the primitive value type for SharedPreferences entries.

const Int

Seeds data inside the application sandbox before a backup.

const Int

Verifies restored data inside the application sandbox after a restore.

const String

Status value indicating failed execution.

const String

Status value indicating successful execution.

const String

Storage type value indicating SQLite database.

const String

Storage type value indicating raw file storage.

const String

Storage type value indicating SharedPreferences.

Public functions

BackupDeviceActionResult

Runs the action payload.

Public properties

Int

Lifecycle phase when this action runs.

Constants

KEY_DB_NAME

Added in 1.0.0-alpha01
const val KEY_DB_NAMEString

Key specifying the SQLite database filename.

KEY_ERROR

Added in 1.0.0-alpha01
const val KEY_ERRORString

Key containing the error message in BackupDeviceActionResult upon failure.

Present when KEY_STATUS is STATUS_FAILURE.

KEY_EXPECTED

Added in 1.0.0-alpha01
const val KEY_EXPECTEDString

Key specifying the expected value in verification.

KEY_EXPECTED_COL

Added in 1.0.0-alpha01
const val KEY_EXPECTED_COLString

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

KEY_EXPECTED_VAL

Added in 1.0.0-alpha01
const val KEY_EXPECTED_VALString

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
const val KEY_EXPECT_NULLString

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
const val KEY_IS_BINARYString

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
const val KEY_IS_DEVICE_PROTECTEDString

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
const val KEY_KEY_COLString

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

KEY_KEY_VAL

Added in 1.0.0-alpha01
const val KEY_KEY_VALString

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

KEY_PATH

Added in 1.0.0-alpha01
const val KEY_PATHString

Key specifying a relative or absolute file path.

KEY_PREF_KEY

Added in 1.0.0-alpha01
const val KEY_PREF_KEYString

Key specifying the SharedPreferences preference key.

KEY_PREF_NAME

Added in 1.0.0-alpha01
const val KEY_PREF_NAMEString

Key specifying the SharedPreferences filename.

KEY_STATUS

Added in 1.0.0-alpha01
const val KEY_STATUSString

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
const val KEY_STORAGE_TYPEString

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
const val KEY_TABLEString

Key specifying the table name inside the SQLite database.

KEY_VALUE

Added in 1.0.0-alpha01
const val KEY_VALUEString

Key specifying the value to write or verify.

KEY_VALUES

Added in 1.0.0-alpha01
const val KEY_VALUESString

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
const val KEY_VALUE_TYPEString

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
const val PHASE_POPULATE = 1: Int

Seeds data inside the application sandbox before a backup.

PHASE_VERIFY

Added in 1.0.0-alpha01
const val PHASE_VERIFY = 2: Int

Verifies restored data inside the application sandbox after a restore.

STATUS_FAILURE

Added in 1.0.0-alpha01
const val STATUS_FAILUREString

Status value indicating failed execution.

STATUS_SUCCESS

Added in 1.0.0-alpha01
const val STATUS_SUCCESSString

Status value indicating successful execution.

STORAGE_TYPE_DATABASE

Added in 1.0.0-alpha01
const val STORAGE_TYPE_DATABASEString

Storage type value indicating SQLite database.

STORAGE_TYPE_FILES

Added in 1.0.0-alpha01
const val STORAGE_TYPE_FILESString

Storage type value indicating raw file storage.

STORAGE_TYPE_PREFS

Added in 1.0.0-alpha01
const val STORAGE_TYPE_PREFSString

Storage type value indicating SharedPreferences.

Public functions

execute

Added in 1.0.0-alpha01
fun execute(context: Context, args: BackupDeviceActionArgs): BackupDeviceActionResult

Runs the action payload.

Parameters
context: Context

application context on the target device

args: BackupDeviceActionArgs

input arguments passed from the host orchestrator

Returns
BackupDeviceActionResult

result returned to the host

Public properties

phase

Added in 1.0.0-alpha01
val phaseInt

Lifecycle phase when this action runs.