to top
public class

DeviceBuildDescriptor

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

Class Overview

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.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String DEVICE_BUILD_ALIAS

Constant Value: "device_build_alias"

public static final String DEVICE_BUILD_FLAVOR

Constant Value: "device_build_flavor"

public static final String DEVICE_BUILD_ID

Constant Value: "device_build_id"

public static final String DEVICE_DESC

Constant Value: "device_description"

public static final String DEVICE_PRODUCT

Constant Value: "device_product"

Public Constructors

public DeviceBuildDescriptor (IBuildInfo build)

Parameters
build IBuildInfo

Public Methods

public static boolean describesDeviceBuild (IBuildInfo build)

Determines if given IBuildInfo contains device build metadata

Returns
boolean

public static 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
Throws
DeviceNotAvailableException

public static String generateDeviceProduct (ITestDevice device)

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

Parameters
device ITestDevice
Returns
String
Throws
DeviceNotAvailableException

public String getDeviceBuildAlias ()

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

Returns
String

public String getDeviceBuildFlavor ()

Gets the device build flavor eg yakju-userdebug.

Returns
String

public String getDeviceBuildId ()

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

Returns
String

public String getDeviceProduct ()

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

Returns
String

public 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

public static void injectDeviceAttributes (ITestDevice device, IBuildInfo b)

Inserts attributes from device into build.

Parameters
b IBuildInfo
Throws
DeviceNotAvailableException