DeviceBuildDescriptor

public class DeviceBuildDescriptor
extends Object

java.lang.Object
   ↳ com.android.tradefed.build.DeviceBuildDescriptor


A wrapper class for a IBuildInfo, that contains helper methods to retrieve device platform build information.

Intended to be use for "unbundled" aka not device builds IBuildInfo, that desire metadata about what device the build was run on.

Summary

Constants

String DEVICE_BUILD_ALIAS

String DEVICE_BUILD_FLAVOR

String DEVICE_BUILD_ID

String DEVICE_DESC

String DEVICE_PRODUCT

Public constructors

DeviceBuildDescriptor(IBuildInfo build)

Public methods

static boolean describesDeviceBuild(IBuildInfo build)

Determines if given IBuildInfo contains device build metadata

static String generateDeviceDesc(ITestDevice device)

Generate the device description string from device properties.

static String generateDeviceProduct(ITestDevice device)

Query the product and variant of the device, in product:variant format.

String getDeviceBuildAlias()

Gets the device build alias.

String getDeviceBuildFlavor()

Gets the device build flavor eg yakju-userdebug.

String getDeviceBuildId()

Gets the device build ID.

String getDeviceProduct()

Get the product and variant of the device, in product:variant format.

String getDeviceUserDescription()

Gets a description of the device and build.

static void injectDeviceAttributes(ITestDevice device, IBuildInfo b)

Inserts attributes from device into build.

Constants

DEVICE_BUILD_ALIAS

String DEVICE_BUILD_ALIAS

Constant Value: "device_build_alias"

DEVICE_BUILD_FLAVOR

String DEVICE_BUILD_FLAVOR

Constant Value: "device_build_flavor"

DEVICE_BUILD_ID

String DEVICE_BUILD_ID

Constant Value: "device_build_id"

DEVICE_DESC

String DEVICE_DESC

Constant Value: "device_description"

DEVICE_PRODUCT

String DEVICE_PRODUCT

Constant Value: "device_product"

Public constructors

DeviceBuildDescriptor

DeviceBuildDescriptor (IBuildInfo build)

Parameters
build IBuildInfo

Public methods

describesDeviceBuild

boolean describesDeviceBuild (IBuildInfo build)

Determines if given IBuildInfo contains device build metadata

Returns
boolean True if the IBuildInfo contains the device build metadata, false otherwise

generateDeviceDesc

String generateDeviceDesc (ITestDevice device)

Generate the device description string from device properties.

Description should follow this format: eg Google Galaxy Nexus 4.2

Returns
String The device description string
Throws
DeviceNotAvailableException

generateDeviceProduct

String generateDeviceProduct (ITestDevice device)

Query the product and variant of the device, in product:variant format.

Parameters
device ITestDevice
Returns
String
Throws
DeviceNotAvailableException

getDeviceBuildAlias

String getDeviceBuildAlias ()

Gets the device build alias. Maps to the ro.build.id property on device. Typically follows format IMM76.

Returns
String

getDeviceBuildFlavor

String getDeviceBuildFlavor ()

Gets the device build flavor eg yakju-userdebug.

Returns
String

getDeviceBuildId

String getDeviceBuildId ()

Gets the device build ID. Maps to the ro.build.incremental.id property on device.

Returns
String

getDeviceProduct

String getDeviceProduct ()

Get the product and variant of the device, in product:variant format.

Returns
String

getDeviceUserDescription

String getDeviceUserDescription ()

Gets a description of the device and build. This is typically a more end-user friendly description compared with getDeviceBuildAlias() and getDeviceBuildFlavor() but with the possible penalty of being less precise. eg. it wouldn't be possible to distinguish the GSM (yakju) and CDMA (mysid) variants of Google Galaxy Nexus using this string.

Returns
String

injectDeviceAttributes

void injectDeviceAttributes (ITestDevice device, 
                IBuildInfo b)

Inserts attributes from device into build.

Parameters
b IBuildInfo
Throws
DeviceNotAvailableException