RunOnWorkProfileTargetPreparer

public class RunOnWorkProfileTargetPreparer
extends BaseTargetPreparer implements IConfigurationReceiver

java.lang.Object
com.android.tradefed.targetprep.BaseTargetPreparer
com.android.tradefed.targetprep.RunOnWorkProfileTargetPreparer


ITargetPreparer ,用於在設定中建立工作設定文件,並標記應在該使用者中執行測試。

在拆卸過程中,工作設定檔將被刪除。

如果工作設定檔已存在,則會使用該工作設定檔而不是建立新的工作設定文件,並且在拆卸時不會將其刪除。

如果裝置沒有 Managed_users 功能,或在需要時沒有能力建立新用戶,則會設定偵測參數skip-tests-reason,且不會變更使用者。在設備上執行的測試可以讀取此參數來回應此狀態。

概括

公共構造函數

RunOnWorkProfileTargetPreparer ()

公共方法

void setConfiguration ( IConfiguration configuration)

注入正在使用的IConfiguration

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

受保護的方法

boolean canCreateAdditionalUsers (ITestDevice device, int numberOfUsers)

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

公共構造函數

RunOnWorkProfileTargetPreparer

public RunOnWorkProfileTargetPreparer ()

公共方法

設定配置

public void setConfiguration (IConfiguration configuration)

注入正在使用的IConfiguration

參數
configuration IConfiguration

設定

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