设备监视器
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 () 当监视器需要停止时将调用的方法。 |
公共方法
通知设备状态改变
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 | IDeviceMonitor.DeviceLister |
停止
public abstract void stop ()
当监视器需要停止时将调用的方法。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2023-07-19。
[{
"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":"其他"
}]