ManagedDeviceList
class
ManagedDeviceList
extends Object
implements
Iterable<IManagedTestDevice>
java.lang.Object | |
↳ | com.android.tradefed.device.ManagedDeviceList |
A thread-safe data structure that holds all devices known to DeviceManager
.
ConcurrentModificationException
will not be thrown, but the iterator
will also not reflect the modified contents.
Summary
Public constructors | |
---|---|
ManagedDeviceList(IManagedTestDeviceFactory d)
|
Public methods | |
---|---|
IManagedTestDevice
|
allocate(IDeviceSelection options)
Attempt to allocate a device from the list |
IManagedTestDevice
|
find(String serialNumber)
Finds the device with the given serial |
IManagedTestDevice
|
findOrCreate(IDevice idevice)
Find the |
IManagedTestDevice.DeviceEventResponse
|
handleDeviceEvent(IManagedTestDevice d, DeviceEvent event)
Handle a device event for given device. |
Iterator<IManagedTestDevice>
|
iterator()
|
int
|
size()
Return the number of elements in the list |
void
|
updateFastbootStates(Set<String> serials)
Update the |
Public constructors
ManagedDeviceList
public ManagedDeviceList (IManagedTestDeviceFactory d)
Parameters | |
---|---|
d |
IManagedTestDeviceFactory |
Public methods
allocate
public IManagedTestDevice allocate (IDeviceSelection options)
Attempt to allocate a device from the list
Returns | |
---|---|
IManagedTestDevice |
the IManagedTestDevice that was successfully allocated, null otherwise
|
find
public IManagedTestDevice find (String serialNumber)
Finds the device with the given serial
Returns | |
---|---|
IManagedTestDevice |
the IManagedTestDevice or null if not found
|
findOrCreate
public IManagedTestDevice findOrCreate (IDevice idevice)
Find the IManagedTestDevice
corresponding to the IDevice
. If it does not
exist, create a new one.
Returns | |
---|---|
IManagedTestDevice |
the IManagedTestDevice .
|
handleDeviceEvent
public IManagedTestDevice.DeviceEventResponse handleDeviceEvent (IManagedTestDevice d, DeviceEvent event)
Handle a device event for given device. Will remove device from list if state transitions to unknown.
DeviceManager
should always make calls through this method as opposed to calling
IManagedTestDevice.handleAllocationEvent(DeviceEvent)
directly, to ensure list stays
valid.
Parameters | |
---|---|
d |
IManagedTestDevice |
event |
DeviceEvent |
Returns | |
---|---|
IManagedTestDevice.DeviceEventResponse |
size
public int size ()
Return the number of elements in the list
Returns | |
---|---|
int |
updateFastbootStates
public void updateFastbootStates (Set<String> serials)
Update the NativeDevice.getDeviceState()
of devices as appropriate.
Parameters | |
---|---|
serials |
Set : the devices currently on fastboot
|
Interfaces
- IAndroidDebugBridge
- IBatteryTemperature
- IDeviceManager
- IDeviceManager.IFastbootListener
- IDeviceMonitor
- IDeviceRecovery
- IDeviceSelection
- IDeviceStateMonitor
- IFileEntry
- ILogcatReceiver
- IManagedTestDevice
- IManagedTestDeviceFactory
- IMultiDeviceRecovery
- INativeDevice
- ITestDevice
- ITestDeviceMutator
- IWifiHelper
- NativeDevice.DeviceAction
Classes
- AndroidDebugBridgeWrapper
- BackgroundDeviceAction
- BatteryTemperature
- BatteryTemperature.DumpsysBatteryTemperatureReceiver
- CollectingByteOutputReceiver
- CollectingOutputReceiver
- CpuStatsCollector
- CpuStatsCollector.CpuStats
- CpuStatsCollector.CpuStatsReceiver
- DeviceDiagTest
- DeviceManager
- DeviceManager.FastbootDevice
- DeviceMonitorMultiplexer
- DeviceProperties
- DeviceSelectionOptions
- DeviceStateMonitor
- DeviceUtilStatsMonitor
- DeviceUtilStatsMonitor.UtilizationDesc
- DumpsysPackageReceiver
- FastbootHelper
- FileEntryWrapper
- IDeviceMonitor.DeviceLister
- IManagedTestDevice.DeviceEventResponse
- ITestDevice.MountPointInfo
- LargeOutputReceiver
- LogcatReceiver
- ManagedDeviceList
- ManagedTestDeviceFactory
- NativeDevice
- NativeDevice.AdbAction
- NativeDevice.AdbShellAction
- NativeDeviceStateMonitor
- NullDevice
- PackageInfo
- ReconnectingRecovery
- RemoteAndroidDevice
- RetryingWaitDeviceRecovery
- StubDevice
- TcpDevice
- TestDevice
- TestDeviceMutator
- TestDeviceOptions
- TopHelper
- TopHelper.TopReceiver
- TopHelper.TopStats
- WaitDeviceRecovery
- WifiHelper
Enums
Exceptions