BuildInfoUtil

public class BuildInfoUtil
extends Object

java.lang.Object
   ↳ com.android.tradefed.util.BuildInfoUtil


A util class to help manipulate IBuildInfo

Summary

Public constructors

BuildInfoUtil()

Public methods

static void bootstrapDeviceBuildAttributes(IBuildInfo buildInfo, ITestDevice device, String overrideBuildId, String overrideBuildFlavor, String overrideBuildBranch, String overrideBuildAlias)

Reads build attributes from device and use them to override the relevant build info fields

Note: because branch information is not stored on device as build attributes, the injected branch info will be the following fields concatenated via dashes:

  • ro.product.brand
  • ro.product.name
  • ro.product.vendor.device (maybe different on older API levels)
  • ro.build.version.release

Public constructors

BuildInfoUtil

public BuildInfoUtil ()

Public methods

bootstrapDeviceBuildAttributes

public static void bootstrapDeviceBuildAttributes (IBuildInfo buildInfo, 
                ITestDevice device, 
                String overrideBuildId, 
                String overrideBuildFlavor, 
                String overrideBuildBranch, 
                String overrideBuildAlias)

Reads build attributes from device and use them to override the relevant build info fields

Note: because branch information is not stored on device as build attributes, the injected branch info will be the following fields concatenated via dashes:

  • ro.product.brand
  • ro.product.name
  • ro.product.vendor.device (maybe different on older API levels)
  • ro.build.version.release

Parameters
buildInfo IBuildInfo: the build info where device build attributes will be injected

device ITestDevice: the device to read build attributes from

overrideBuildId String: instead of reading from device, override build id to this value; null for no override

overrideBuildFlavor String: instead of reading from device, override build flavor to this value; null for no override

overrideBuildBranch String: instead of concatenating device attributes as substitute for branch, override it to this value; null for no override

overrideBuildAlias String: instead of reading from device, override build alias to this value; null for no override

Throws
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException