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
  • 要用於可逆性測試,指定 all-on 文件後跟 all-off 文件,並在兩個文件之間啟用重啟:
    --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 ()

公共方法

設置

public void setUp (TestInformation testInformation)

參數
testInformation TestInformation

投擲
BuildError
DeviceNotAvailableException
TargetSetupError

拆除

public void tearDown (TestInformation testInformation, 
                Throwable e)

參數
testInformation TestInformation

e Throwable

投擲
DeviceNotAvailableException