設備監視器
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 () 在設置了所有 Monitor 的 @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 ()
在設置了所有 Monitor 的 @Option 字段後將調用的方法。
設置設備列表
public abstract void setDeviceLister (IDeviceMonitor.DeviceLister lister)
允許DeviceLister
進行設置。在成功嘗試設置 Lister 後,實現可能會丟棄所有後續嘗試。
參數 | |
---|---|
lister | IDeviceMonitor.DeviceLister |
停止
public abstract void stop ()
當需要停止 Monitor 時將調用的方法。
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2021-10-04 UTC.
[{
"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":"其他"
}]