管理測試設備

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