RunOnSecondaryUserTargetPreparer
public class RunOnSecondaryUserTargetPreparer
extends BaseTargetPreparer
java.lang.Object | ||
↳ | com.android.tradefed.targetprep.BaseTargetPreparer | |
↳ | com.android.tradefed.targetprep.RunOnSecondaryUserTargetPreparer |
一個ITargetPreparer
,它在設置中創建一個輔助用戶,並標記應該在該用戶中運行的測試。
在拆解中,次級用戶被移除。
如果二級用戶已經存在,它將被使用而不是創建一個新的,並且它不會在拆卸時被刪除。
如果設備沒有能力在需要時創建新用戶,則將設置檢測參數 skip-tests-reason,並且不會更改用戶。在設備上運行的測試可以讀取此參數以響應此狀態。
概括
公共構造函數 | |
---|---|
RunOnSecondaryUserTargetPreparer () |
公共方法 | |
---|---|
void | setUp ( TestInformation testInfo) |
void | tearDown ( TestInformation testInfo, Throwable e) |
受保護的方法 | |
---|---|
boolean | canCreateAdditionalUsers ( ITestDevice device, int numberOfUsers) 檢查是否可以創建所需數量的用戶。 |
公共構造函數
RunOnSecondaryUserTargetPreparer
public RunOnSecondaryUserTargetPreparer ()
公共方法
設置
public void setUp (TestInformation testInfo)
參數 | |
---|---|
testInfo | TestInformation |
投擲 | |
---|---|
DeviceNotAvailableException | |
TargetSetupError |
拆除
public void tearDown (TestInformation testInfo, Throwable e)
參數 | |
---|---|
testInfo | TestInformation |
e | Throwable |
投擲 | |
---|---|
DeviceNotAvailableException |
受保護的方法
可以創建其他用戶
protected boolean canCreateAdditionalUsers (ITestDevice device, int numberOfUsers)
檢查是否可以創建所需數量的用戶。
參數 | |
---|---|
device | ITestDevice |
numberOfUsers | int |
退貨 | |
---|---|
boolean |
投擲 | |
---|---|
DeviceNotAvailableException |