管理测试设备

public interface IManagedTestDevice
implements ITestDevice

com.android.tradefed.device.IManagedTestDevice


生命周期受管理的 ITestDevice。

概括

嵌套类

class IManagedTestDevice.DeviceEventResponse

用于响应IManagedTestDevice#handleAllocationEvent(DeviceEvent)调用的容器

公共方法

abstract DeviceAllocationState getAllocationState ()

返回设备当前的分配状态

abstract Process getEmulatorProcess ()

返回该模拟器对应的Process

abstract String getFastbootPath ()

返回正在使用的 fastboot 二进制文件的路径。

abstract String getFastbootVersion ()

返回正在使用的 fastboot 二进制文件的版本字符串。

abstract String getMacAddress ()

返回设备的MAC地址,如果向设备查询失败则返回null。

abstract IDeviceStateMonitor getMonitor ()

返回与设备关联的IDeviceStateMonitor

abstract String getSimOperator ()

返回 SIM 卡运营商,如果不可用或设备不可用,则返回 null。

abstract String getSimState ()

返回 SIM 卡状态,如果不可用或设备不可用,则返回 null。

abstract IManagedTestDevice.DeviceEventResponse handleAllocationEvent (DeviceEvent event)

处理给定的DeviceEvent。

abstract boolean isFastbootEnabled ()

返回设备是否可以使用 fastboot。

abstract boolean recoverDevice ()

在设备上调用恢复。

abstract void setDeviceState ( TestDeviceState deviceState)

更新设备的状态。

abstract void setEmulatorProcess (Process p)

当该设备是模拟器时,设置Process

abstract void setFastbootEnabled (boolean fastbootEnabled)

设置设备的快速启动选项。

abstract void setFastbootPath (String fastbootPath)

设置应使用的 fastboot 二进制文件的路径。

abstract void setIDevice (IDevice device)

更新与此 ITestDevice 关联的 IDevice。

公共方法

获取分配状态

public abstract DeviceAllocationState getAllocationState ()

返回设备当前的分配状态

退货
DeviceAllocationState

获取模拟器进程

public abstract Process getEmulatorProcess ()

返回该模拟器对应的Process

退货
Process Processnull

获取快速启动路径

public abstract String getFastbootPath ()

返回正在使用的 fastboot 二进制文件的路径。仍然需要isFastbootEnabled()为 true,才能启用 fastboot 功能。

退货
String

获取Fastboot版本

public abstract String getFastbootVersion ()

返回正在使用的 fastboot 二进制文件的版本字符串。如果出现问题则为 null。

退货
String

获取Mac地址

public abstract String getMacAddress ()

返回设备的MAC地址,如果向设备查询失败则返回null。

退货
String

获取监视器

public abstract IDeviceStateMonitor getMonitor ()

返回与设备关联的IDeviceStateMonitor

退货
IDeviceStateMonitor

获取Sim算子

public abstract String getSimOperator ()

返回 SIM 卡运营商,如果不可用或设备不可用,则返回 null。

退货
String

获取模拟状态

public abstract String getSimState ()

返回 SIM 卡状态,如果不可用或设备不可用,则返回 null。

退货
String

处理分配事件

public abstract IManagedTestDevice.DeviceEventResponse handleAllocationEvent (DeviceEvent event)

处理给定的DeviceEvent。可以将设备转换到新状态。将通知IDeviceMonitor任何状态转换。

参数
event DeviceEvent

退货
IManagedTestDevice.DeviceEventResponse

是否启用快速启动

public abstract boolean isFastbootEnabled ()

返回设备是否可以使用 fastboot。

退货
boolean

恢复设备

public abstract boolean recoverDevice ()

在设备上调用恢复。

退货
boolean如果尝试恢复并成功则返回 True,如果跳过恢复则返回 False

投掷
DeviceNotAvailableException如果恢复不成功

设置设备状态

public abstract void setDeviceState (TestDeviceState deviceState)

更新设备的状态。

参数
deviceState TestDeviceStateTestDeviceState

设置模拟器进程

public abstract void setEmulatorProcess (Process p)

当该设备是模拟器时,设置Process

参数
p Process

设置快速启动启用

public abstract void setFastbootEnabled (boolean fastbootEnabled)

设置设备的快速启动选项。应在首次分配设备时设置。

参数
fastbootEnabled boolean : 设备是否可以使用 fastboot

设置快速启动路径

public abstract void setFastbootPath (String fastbootPath)

设置应使用的 fastboot 二进制文件的路径。仍然需要isFastbootEnabled()为 true,才能启用 fastboot 功能。

参数
fastbootPath String

设置设备

public abstract void setIDevice (IDevice device)

更新与此 ITestDevice 关联的 IDevice。

新的 IDevice 必须引用与当前引用相同的物理设备。如果 DDMS 分配了新的 IDevice,则将调用此方法

参数
device IDeviceIDevice