IDeviceSelection

public interface IDeviceSelection
implements IMatcher<IDevice>

com.android.tradefed.device.IDeviceSelection


Interface for device selection criteria.

Summary

Public methods

abstract boolean deviceRequested()
abstract boolean emulatorRequested()
abstract boolean gceDeviceRequested()
abstract IDeviceSelection.BaseDeviceType getBaseDeviceTypeRequested()

Returns the device type we should use.

abstract Integer getBatteryLevel(IDevice device)

Retrieves the battery level for the given device

abstract String getDeviceProductType(IDevice device)

Gets the given devices product type

abstract String getDeviceProductVariant(IDevice device)

Gets the given devices product variant

abstract getExcludeSerials()

Gets a copy of the serial numbers exclusion list

abstract getNoMatchReason()

Returns the reason for which the device was not matched.

abstract getProductTypes()

Gets a copy of the product type list

abstract getProperties()

Returns a map of the property list

abstract getSerials(IDevice device)

Gets a copy of the serial numbers

abstract getSerials()

Returns the list of requested serials.

abstract boolean nullDeviceRequested()
abstract void setBaseDeviceTypeRequested(IDeviceSelection.BaseDeviceType type)

Sets the device type we should use.

abstract void setRequireBatteryCheck(boolean requireCheck)

Sets whether or not we want to do the battery check.

abstract void setSerial(String... serialNumber)

Set the serial numbers inclusion list, replacing any existing values.

abstract boolean stubEmulatorRequested()
default boolean tcpDeviceRequested()

Public methods

deviceRequested

public abstract boolean deviceRequested ()

Returns
boolean true if a device has been requested

emulatorRequested

public abstract boolean emulatorRequested ()

Returns
boolean true if an emulator has been requested

gceDeviceRequested

public abstract boolean gceDeviceRequested ()

Returns
boolean true if a gce device (aka a remote device) has been requested

getBaseDeviceTypeRequested

public abstract IDeviceSelection.BaseDeviceType getBaseDeviceTypeRequested ()

Returns the device type we should use.

Returns
IDeviceSelection.BaseDeviceType

getBatteryLevel

public abstract Integer getBatteryLevel (IDevice device)

Retrieves the battery level for the given device

Parameters
device IDevice: the IDevice

Returns
Integer the device battery level or null if unknown

getDeviceProductType

public abstract String getDeviceProductType (IDevice device)

Gets the given devices product type

Parameters
device IDevice: the IDevice

Returns
String the device product type or null if unknown

getDeviceProductVariant

public abstract String getDeviceProductVariant (IDevice device)

Gets the given devices product variant

Parameters
device IDevice: the IDevice

Returns
String the device product variant or null if unknown

getExcludeSerials

public abstract  getExcludeSerials ()

Gets a copy of the serial numbers exclusion list

Returns
a ERROR(/Collection) of serial numbers

getNoMatchReason

public abstract  getNoMatchReason ()

Returns the reason for which the device was not matched.

Returns
a Map of serial number to reason for which it wasn't allocated

getProductTypes

public abstract  getProductTypes ()

Gets a copy of the product type list

Returns
a ERROR(/Collection) of product types

getProperties

public abstract  getProperties ()

Returns a map of the property list

Returns
a ERROR(/Map) of device property names to values

getSerials

public abstract  getSerials (IDevice device)

Gets a copy of the serial numbers

Parameters
device IDevice: The IDevice representing the device considered for selection.

Returns
a ERROR(/Collection) of serial numbers

getSerials

public abstract  getSerials ()

Returns the list of requested serials.

Returns

nullDeviceRequested

public abstract boolean nullDeviceRequested ()

Returns
boolean true if a null device (aka no device required) has been requested

setBaseDeviceTypeRequested

public abstract void setBaseDeviceTypeRequested (IDeviceSelection.BaseDeviceType type)

Sets the device type we should use.

Parameters
type IDeviceSelection.BaseDeviceType

setRequireBatteryCheck

public abstract void setRequireBatteryCheck (boolean requireCheck)

Sets whether or not we want to do the battery check.

Parameters
requireCheck boolean

setSerial

public abstract void setSerial (String... serialNumber)

Set the serial numbers inclusion list, replacing any existing values.

Parameters
serialNumber String

stubEmulatorRequested

public abstract boolean stubEmulatorRequested ()

Returns
boolean true if an stub emulator has been requested. A stub emulator is a placeholder to be used when config has to launch an emulator.

tcpDeviceRequested

public boolean tcpDeviceRequested ()

Returns
boolean true if a tcp device (aka a adb connected device) has been requested