设备监视器
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 时将调用的方法。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
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":"其他"
}]