设备监视器
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.
[]
[]