IManagedTestDevice
public
interface
IManagedTestDevice
implements
ITestDevice
com.android.tradefed.device.IManagedTestDevice |
生命週期受管理的 ITestDevice。
摘要
巢狀類別 | |
---|---|
class |
IManagedTestDevice.DeviceEventResponse
用於回應 |
公用方法 | |
---|---|
abstract
DeviceAllocationState
|
getAllocationState()
傳回裝置目前的分配狀態 |
abstract
Process
|
getEmulatorProcess()
傳回與此模擬器對應的 |
abstract
String
|
getFastbootPath()
傳回所用快速系統啟動二進位檔的路徑。 |
abstract
String
|
getFastbootVersion()
傳回所用 fastboot 二進位檔的版本字串。 |
abstract
String
|
getMacAddress()
傳回裝置的 MAC 位址,如果無法從裝置查詢,則傳回空值。 |
abstract
IDeviceStateMonitor
|
getMonitor()
傳回與裝置相關聯的 |
abstract
String
|
getSimOperator()
傳回 SIM 卡電信業者,如果無法取得或裝置不可用,則傳回空值。 |
abstract
String
|
getSimState()
傳回 SIM 卡狀態,如果無法使用或裝置不可用,則傳回空值。 |
abstract
IManagedTestDevice.DeviceEventResponse
|
handleAllocationEvent(DeviceEvent event)
處理指定的 DeviceEvent。 |
abstract
boolean
|
isFastbootEnabled()
傳回裝置是否可使用 Fastboot。 |
abstract
boolean
|
recoverDevice()
在裝置上叫用復原功能。 |
abstract
void
|
setDeviceState(TestDeviceState deviceState)
更新裝置狀態。 |
abstract
void
|
setEmulatorProcess(Process p)
當裝置為模擬器時,會設定 |
abstract
void
|
setFastbootEnabled(boolean fastbootEnabled)
設定裝置的 Fastboot 選項。 |
abstract
void
|
setFastbootPath(String fastbootPath)
設定應使用的 fastboot 二進位檔路徑。 |
abstract
void
|
setIDevice(IDevice device)
更新與此 ITestDevice 相關聯的 IDevice。 |
公用方法
getAllocationState
public abstract DeviceAllocationState getAllocationState ()
傳回裝置目前的分配狀態
傳回 | |
---|---|
DeviceAllocationState |
getEmulatorProcess
public abstract Process getEmulatorProcess ()
傳回與此模擬器對應的 Process
。
傳回 | |
---|---|
Process |
Process 或 null |
getFastbootPath
public abstract String getFastbootPath ()
傳回所用快速系統啟動模式二進位檔的路徑。仍需要將 isFastbootEnabled()
設為 True,才能啟用 fastboot 功能。
傳回 | |
---|---|
String |
getFastbootVersion
public abstract String getFastbootVersion ()
傳回所用 fastboot 二進位檔的版本字串。或在發生錯誤時為空值。
傳回 | |
---|---|
String |
getMacAddress
public abstract String getMacAddress ()
傳回裝置的 MAC 位址,如果無法從裝置查詢,則傳回空值。
傳回 | |
---|---|
String |
getMonitor
public abstract IDeviceStateMonitor getMonitor ()
傳回與裝置相關聯的 IDeviceStateMonitor
。
傳回 | |
---|---|
IDeviceStateMonitor |
getSimOperator
public abstract String getSimOperator ()
傳回 SIM 卡電信業者,如果無法取得或裝置不可用,則傳回空值。
傳回 | |
---|---|
String |
getSimState
public abstract String getSimState ()
傳回 SIM 卡狀態,如果無法取得或裝置不可用,則傳回空值。
傳回 | |
---|---|
String |
handleAllocationEvent
public abstract IManagedTestDevice.DeviceEventResponse handleAllocationEvent (DeviceEvent event)
處理指定的 DeviceEvent。可能會將裝置轉換至新狀態。會通知 IDeviceMonitor
任何狀態轉換。
參數 | |
---|---|
event |
DeviceEvent |
傳回 | |
---|---|
IManagedTestDevice.DeviceEventResponse |
isFastbootEnabled
public abstract boolean isFastbootEnabled ()
傳回裝置是否可使用 Fastboot。
傳回 | |
---|---|
boolean |
recoverDevice
public abstract boolean recoverDevice ()
在裝置上叫用復原作業。
傳回 | |
---|---|
boolean |
如果嘗試復原且成功,則傳回 True;如果略過復原,則傳回 False |
擲回 | |
---|---|
DeviceNotAvailableException |
如果復原作業失敗 |
setDeviceState
public abstract void setDeviceState (TestDeviceState deviceState)
更新裝置狀態。
參數 | |
---|---|
deviceState |
TestDeviceState :TestDeviceState |
setEmulatorProcess
public abstract void setEmulatorProcess (Process p)
當裝置為模擬器時,會設定 Process
。
參數 | |
---|---|
p |
Process |
setFastbootEnabled
public abstract void setFastbootEnabled (boolean fastbootEnabled)
設定裝置的 Fastboot 選項。應在裝置首次分配時設定。
參數 | |
---|---|
fastbootEnabled |
boolean :裝置是否可使用 Fastboot |
setFastbootPath
public abstract void setFastbootPath (String fastbootPath)
設定應使用的 fastboot 二進位檔路徑。仍需要將 isFastbootEnabled()
設為 True,才能啟用 fastboot 功能。
參數 | |
---|---|
fastbootPath |
String |
setIDevice
public abstract void setIDevice (IDevice device)
更新與此 ITestDevice 相關聯的 IDevice。
新的 IDevice 必須參照與目前參照相同的實體裝置。如果 DDMS 已分配新的 IDevice,就會呼叫這個方法
參數 | |
---|---|
device |
IDevice :IDevice |