AFlagsTargetPreparer

public class AFlagsTargetPreparer
extends BaseTargetPreparer

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


在執行測試前,使用 aflags 覆寫旗標。如果變更了任何標記,裝置會重新啟動,新值才會生效。

拆除時,所有旗標都會還原為先前的狀態。如果標記已從預設值變更,系統會清除覆寫值 (以便預設值生效,並允許再次由伺服器覆寫)。如果先前已將旗標覆寫為其他值,系統會再次將旗標設為該值。

如果目前的旗標狀態與目標狀態相符,系統就不會覆寫旗標。如果仍想在此情況下覆寫 (例如防止預設設定的旗標遭伺服器覆寫),可以使用 --force-set 選項。

使用範例:--flag-value namespace/flag_name=true --flag-value other_namespace/another_flag=false

摘要

公用建構函式

AFlagsTargetPreparer()

公用方法

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

公用建構函式

AFlagsTargetPreparer

public AFlagsTargetPreparer ()

公用方法

setUp

public void setUp (TestInformation testInformation)

參數
testInformation TestInformation

擲回
BuildError
DeviceNotAvailableException
TargetSetupError

tearDown

public void tearDown (TestInformation testInformation, 
                Throwable e)

參數
testInformation TestInformation

e Throwable

擲回
DeviceNotAvailableException