FeatureFlagTargetPreparer

public class FeatureFlagTargetPreparer
extends BaseTargetPreparer

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


更新 DeviceConfig(由远程服务调整的功能标志)。

这可用于重现设备的状态(使用 `adb shell device_config list` 将所有标志值转储到文件中),或批量启用/停用标志(全部启用/全部停用测试)。

用法示例:

  • 如需用于全开/全关测试,请指定必要的标志文件:
    --flag-file=flag_file_path
  • 如需替换一个或多个标志,请指定其值(可以与标志文件结合使用):
    --flag-file=flag_file_path --flag-value=namespace/name=value
  • 如需用于可逆性测试,请指定全开文件,然后指定全关文件,并在两个文件之间启用重新启动:
    --flag-file=all_on_file_path --flag-file=all_off_file_path --reboot-between-flag-files
           

应与 DeviceSetup 结合使用,以在测试期间停用 DeviceConfig 同步,因为同步可能会覆盖此准备程序所做的更改。

摘要

公共构造函数

FeatureFlagTargetPreparer()

公共方法

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

公共构造函数

FeatureFlagTargetPreparer

public FeatureFlagTargetPreparer ()

公共方法

setUp

public void setUp (TestInformation testInformation)

参数
testInformation TestInformation

抛出
BuildError
DeviceNotAvailableException
TargetSetupError

tearDown

public void tearDown (TestInformation testInformation, 
                Throwable e)

参数
testInformation TestInformation

e Throwable

抛出
DeviceNotAvailableException