ID設備監視器
public interface IDeviceMonitor
com.android.tradefed.device.IDeviceMonitor |
用於監視設備狀態的接口。旨在傳遞給IDeviceManager
實例,此時IDeviceManager
將在觸發相關事件時調用回調。任何緩存或批處理都需要在IDeviceMonitor
實例中執行。
概括
嵌套類 | |
---|---|
class | IDeviceMonitor.DeviceLister 一個類似於 |
公共方法 | |
---|---|
abstract void | notifyDeviceStateChange (String serial, DeviceAllocationState oldState, DeviceAllocationState newState) 向 |
abstract void | run () 設置監視器的所有@Option 字段後將調用的方法。 |
abstract void | setDeviceLister ( IDeviceMonitor.DeviceLister lister) 允許設置 |
abstract void | stop () 需要停止 Monitor 時將調用的方法。 |
公共方法
通知設備狀態變化
public abstract void notifyDeviceStateChange (String serial, DeviceAllocationState oldState, DeviceAllocationState newState)
向IDeviceMonitor
發出設備狀態已更改的信號。監視器實現應限制它們在此方法中執行的處理量和 IDeviceManager/DeviceLister 交互。
參數 | |
---|---|
serial | String |
oldState | DeviceAllocationState |
newState | DeviceAllocationState |
跑步
public abstract void run ()
設置監視器的所有@Option 字段後將調用的方法。
設置設備列表
public abstract void setDeviceLister (IDeviceMonitor.DeviceLister lister)
允許設置DeviceLister
。在成功嘗試設置 Lister 之後,實現可能會放棄所有後續嘗試。
參數 | |
---|---|
lister | IDeviceMonitor.DeviceLister |
停止
public abstract void stop ()
需要停止 Monitor 時將調用的方法。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2023-03-30 (世界標準時間)。
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"缺少我需要的資訊"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"過於複雜/步驟過多"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"過時"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻譯問題"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"示例/程式碼問題"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"容易理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"確實解決了我的問題"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]