RunOnSecondaryUserTargetPreparer

public class RunOnSecondaryUserTargetPreparer
extends BaseTargetPreparer implements IConfigurationReceiver

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


在設定中建立次要使用者的 ITargetPreparer,並標示應在該使用者中執行的測試。

在解構期間,系統會移除次要使用者。

如果已存在次要使用者,系統會使用該使用者,而非建立新的使用者,且不會在拆解時移除該使用者。

如果裝置無法在需要時建立新使用者,則會設定測試工具引數 skip-tests-reason,且不會變更使用者。在裝置上執行的測試可讀取這個引數,以回應此狀態。

摘要

公用建構函式

RunOnSecondaryUserTargetPreparer()

公用方法

void setConfiguration(IConfiguration configuration)

插入正在使用的 IConfiguration

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

受保護的方法

boolean canCreateAdditionalUsers(ITestDevice device, int numberOfUsers)

檢查是否可以建立所需數量的使用者。

公用建構函式

RunOnSecondaryUserTargetPreparer

public RunOnSecondaryUserTargetPreparer ()

公用方法

setConfiguration

public void setConfiguration (IConfiguration configuration)

插入正在使用的 IConfiguration

參數
configuration IConfiguration

setUp

public void setUp (TestInformation testInfo)

參數
testInfo TestInformation

擲回
DeviceNotAvailableException
TargetSetupError

tearDown

public void tearDown (TestInformation testInfo, 
                Throwable e)

參數
testInfo TestInformation

e Throwable

擲回
DeviceNotAvailableException

受保護的方法

canCreateAdditionalUsers

protected boolean canCreateAdditionalUsers (ITestDevice device, 
                int numberOfUsers)

檢查是否可以建立所需數量的使用者。

參數
device ITestDevice

numberOfUsers int

傳回
boolean

擲回
DeviceNotAvailableException