IManagedTestDevice

public interface IManagedTestDevice
implements ITestDevice

com.android.tradefed.device.IManagedTestDevice


生命週期受管理的 ITestDevice。

概括

嵌套類

class IManagedTestDevice.DeviceEventResponse

響應IManagedTestDevice#handleAllocationEvent(DeviceEvent)調用的容器

公共方法

abstract DeviceAllocationState getAllocationState ()

返回設備的當前分配狀態

abstract Process getEmulatorProcess ()

返回與該模擬器對應的ERROR(/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)

當此設備是模擬器時,設置ERROR(/Process)

abstract void setFastbootEnabled (boolean fastbootEnabled)

為設備設置 fastboot 選項。

abstract void setFastbootPath (String fastbootPath)

設置應該使用的 fastboot 二進製文件的路徑。

abstract void setIDevice (IDevice device)

更新與此 ITestDevice 關聯的 IDevice。

公共方法

獲取分配狀態

public abstract DeviceAllocationState getAllocationState ()

返回設備的當前分配狀態

退貨
DeviceAllocationState

getEmulator進程

public abstract Process getEmulatorProcess ()

返回與該模擬器對應的ERROR(/Process)

退貨
Process ERROR(/Process)null

getFastbootPath

public abstract String getFastbootPath ()

返回正在使用的 fastboot 二進製文件的路徑。仍然需要isFastbootEnabled()為真,才能啟用快速啟動功能。

退貨
String

getFastboot版本

public abstract String getFastbootVersion ()

返回正在使用的 fastboot 二進製文件的版本字符串。如果出現問題,則為 null。

退貨
String

獲取Mac地址

public abstract String getMacAddress ()

返回設備的MAC地址,如果向設備查詢失敗則返回null。

退貨
String

獲取監視器

public abstract IDeviceStateMonitor getMonitor ()

返回與設備關聯的IDeviceStateMonitor

退貨
IDeviceStateMonitor

獲取模擬運算符

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

isFastbootEnabled

public abstract boolean isFastbootEnabled ()

如果 fastboot 可用於設備,則返回。

退貨
boolean

恢復設備

public abstract boolean recoverDevice ()

在設備上調用恢復。

退貨
boolean如果嘗試恢復並成功則返回 True,如果跳過恢復則返回 False

投擲
DeviceNotAvailableException如果恢復不成功

設置設備狀態

public abstract void setDeviceState (TestDeviceState deviceState)

更新設備的狀態。

參數
deviceState TestDeviceState : TestDeviceState

設置模擬器進程

public abstract void setEmulatorProcess (Process p)

當此設備是模擬器時,設置ERROR(/Process)

參數
p Process

setFastbootEnabled

public abstract void setFastbootEnabled (boolean fastbootEnabled)

為設備設置 fastboot 選項。應在首次分配設備時設置。

參數
fastbootEnabled boolean : fastboot 是否可用於設備

設置FastbootPath

public abstract void setFastbootPath (String fastbootPath)

設置應該使用的 fastboot 二進製文件的路徑。仍然需要isFastbootEnabled()為真,才能啟用快速啟動功能。

參數
fastbootPath String

設置設備

public abstract void setIDevice (IDevice device)

更新與此 ITestDevice 關聯的 IDevice。

新 IDevice 必須引用與當前引用相同的物理設備。如果 DDMS 已分配新的 IDevice,將調用此方法

參數
device IDevice : IDevice