托管远程设备

public class ManagedRemoteDevice
extends TestDevice implements ITestLoggerReceiver

java.lang.Object
com.android.tradefed.device.NativeDevice
com.android.tradefed.device.TestDevice
com.android.tradefed.device.cloud.ManagedRemoteDevice


在我们通过虚拟机内的 Tradefed 实例远程管理的虚拟机内运行的设备。

概括

公共构造函数

ManagedRemoteDevice (IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)

创建一个ManagedRemoteDevice

公共方法

TestDeviceOptions getOptions ()

在尝试进行远程设置之前覆盖基本的 getter 以便能够解析动态选项。

GceAvdInfo getRemoteAvdInfo ()

返回描述远程实例的GceAvdInfo

void postInvocationTearDown (Throwable exception)

特定于设备的额外步骤需要清理,将在调用完成后执行。

void preInvocationSetup ( IBuildInfo info, MultiMap <String, String> attributes)

设备特定所需设置的额外步骤将在调用流程之前在设备上执行。

void setTestLogger ( ITestLogger testLogger)

注入ITestLogger实例

受保护的方法

long getCurrentTime ()

返回当前系统时间。

void launchGce ( MultiMap <String, String> attributes)

根据构建信息启动实际的 gce 设备。

公共构造函数

托管远程设备

public ManagedRemoteDevice (IDevice device, 
                IDeviceStateMonitor stateMonitor, 
                IDeviceMonitor allocationMonitor)

创建一个ManagedRemoteDevice

参数
device IDevice :关联的IDevice

stateMonitor IDeviceStateMonitor :要使用的IDeviceStateMonitor机制

allocationMonitor IDeviceMonitor :通知分配状态更改的IDeviceMonitor

公共方法

获取选项

public TestDeviceOptions getOptions ()

在尝试进行远程设置之前覆盖基本的 getter 以便能够解析动态选项。

退货
TestDeviceOptions与被测设备相关的TestDeviceOptions

getRemoteAvdInfo

public GceAvdInfo getRemoteAvdInfo ()

返回描述远程实例的GceAvdInfo

退货
GceAvdInfo

postInvocationTearDown

public void postInvocationTearDown (Throwable exception)

特定于设备的额外步骤需要清理,将在调用完成后执行。

参数
exception Throwable :如果有的话,调用失败引发的最终异常。

预调用设置

public void preInvocationSetup (IBuildInfo info, 
                MultiMap<String, String> attributes)

设备特定所需设置的额外步骤将在调用流程之前在设备上执行。

参数
info IBuildInfo :设备的IBuildInfo

attributes MultiMap :存储在调用上下文中的属性

投掷
DeviceNotAvailableException
TargetSetupError

设置测试记录器

public void setTestLogger (ITestLogger testLogger)

注入ITestLogger实例

参数
testLogger ITestLogger

受保护的方法

获取当前时间

protected long getCurrentTime ()

返回当前系统时间。暴露测试。

退货
long

启动Gce

protected void launchGce (MultiMap<String, String> attributes)

根据构建信息启动实际的 gce 设备。

参数
attributes MultiMap

投掷
TargetSetupError