BackupRestoreConfig


@MustBeDocumented
@Retention(value = AnnotationRetention.RUNTIME)
@Target(allowedTargets = [AnnotationTarget.CLASS])
public annotation BackupRestoreConfig


Defines global configuration parameters for the Automated Backup and Restore test runner suite.

Applies to the annotated test class and to its @Nested test classes, which can override individual attributes.

Tests whose test suite properties name the tested app don't need this annotation: without it, they target that app.

Summary

Public methods

final @NonNull String

The target application ID/package name being tested, such as "com.example.myapp".

final @NonNull String

The package name of the test APK whose androidx.test.backup.BackupRestoreTestRunner runs the device actions, such as "com.example.myapp.test".

Public methods

getApplicationId

public final @NonNull String getApplicationId()

The target application ID/package name being tested, such as "com.example.myapp". Defaults to "", which uses the applicationId of an enclosing class, or else the tested app that the test suite properties name.

getTestApplicationId

public final @NonNull String getTestApplicationId()

The package name of the test APK whose androidx.test.backup.BackupRestoreTestRunner runs the device actions, such as "com.example.myapp.test". Needed only when several installed test APKs have that runner for the app. Defaults to "", which uses the testApplicationId of the nearest enclosing class that sets one, unless this class or a class in between sets applicationId. Without one, it uses the only such test APK, or else the one named <applicationId>.test. Device actions fail if the test APK that it names isn't installed or has no such runner for the app.