FeatureFlagTargetPreparer

public class FeatureFlagTargetPreparer
extends BaseTargetPreparer

java.lang.Object
   ↳ com.android.tradefed.targetprep.BaseTargetPreparer
     ↳ com.android.tradefed.targetprep.FeatureFlagTargetPreparer


Updates the DeviceConfig (feature flags tuned by a remote service).

This can be used to reproduce the state of a device (by dumping all flag values to a file using `adb shell device_config list`) or to bulk enable/disable flags (all-on/all-off testing).

Example usage:

  • To use for all-on/all-off testing, specify the necessary flag file:
    --flag-file=flag_file_path
  • To override one or more flags, specify their values (can be combined with flag files):
    --flag-file=flag_file_path --flag-value=namespace/name=value
  • To use for reversibility testing, specify the all-on file followed by the all-off file, and enable rebooting between the two files:
    --flag-file=all_on_file_path --flag-file=all_off_file_path --reboot-between-flag-files
           

Should be used in combination with DeviceSetup to disable DeviceConfig syncing during the test which could overwrite the changes made by this preparer.

Summary

Public constructors

FeatureFlagTargetPreparer()

Public methods

void setUp(TestInformation testInformation)
void tearDown(TestInformation testInformation, Throwable e)

Public constructors

FeatureFlagTargetPreparer

public FeatureFlagTargetPreparer ()

Public methods

setUp

public void setUp (TestInformation testInformation)

Parameters
testInformation TestInformation

Throws
BuildError
DeviceNotAvailableException
TargetSetupError

tearDown

public void tearDown (TestInformation testInformation, 
                Throwable e)

Parameters
testInformation TestInformation

e Throwable

Throws
DeviceNotAvailableException