IDeviceMonitor

public interface IDeviceMonitor

com.android.tradefed.device.IDeviceMonitor
Known Indirect Subclasses
DeviceMonitorMultiplexer A proxy class to propagate requests to multiple IDeviceMonitors. 
DeviceUtilStatsMonitor A IDeviceMonitor that calculates device utilization stats. 


Interface for monitoring state of devices. Intended to be passed to an IDeviceManager instance, at which point the IDeviceManager will invoke callbacks as the related events are triggered. Any caching or batching needs to be performed within the IDeviceMonitor instance.

Summary

Nested classes

class IDeviceMonitor.DeviceLister

A Runnable-like class that should return the known devices and their states. 

Public methods

abstract void notifyDeviceStateChange(String serial, DeviceAllocationState oldState, DeviceAllocationState newState)

Signals the IDeviceMonitor that a device state has been changed.

abstract void run()

A method that will be called after all of the Monitor's @Option fields have been set.

abstract void setDeviceLister(IDeviceMonitor.DeviceLister lister)

Allows the IDeviceMonitor.DeviceLister to be set.

Public methods

notifyDeviceStateChange

void notifyDeviceStateChange (String serial, 
                DeviceAllocationState oldState, 
                DeviceAllocationState newState)

Signals the IDeviceMonitor that a device state has been changed. Monitor implementations should limit the amount of processing and IDeviceManager/DeviceLister interaction they do in this method.

Parameters
serial String
oldState DeviceAllocationState
newState DeviceAllocationState

run

void run ()

A method that will be called after all of the Monitor's @Option fields have been set.

setDeviceLister

void setDeviceLister (IDeviceMonitor.DeviceLister lister)

Allows the IDeviceMonitor.DeviceLister to be set. After a successful attempt to set the Lister, implementations may discard all subsequent attempts.

Parameters
lister IDeviceMonitor.DeviceLister