OtaDeviceBuildInfo

public class OtaDeviceBuildInfo
extends Object implements IDeviceBuildInfo

java.lang.Object
   ↳ com.android.tradefed.build.OtaDeviceBuildInfo
Known Direct Subclasses
OtaToolsDeviceBuildInfo An OtaDeviceBuildInfo that also contains an otatools directory. 


A IDeviceBuildInfo used for over-the-air update testing. It is composed of two device builds for ITestDevice:

  • a baseline build image (the build to OTA from).
  • a OTA build (a build to OTA to). Should contain necessary build attributes and associated OTA package.
this contains the baseline build, and getOtaBuild() returns the OTA build.

Summary

Fields

protected IDeviceBuildInfo mBaselineBuild

protected IDeviceBuildInfo mOtaBuild

protected boolean mReportTargetBuild

Public constructors

OtaDeviceBuildInfo()

Public methods

void addBuildAttribute(String attributeName, String attributeValue)

Add a build attribute

void cleanUp()

Removes all temporary files.

IBuildInfo clone()

File getBasebandImageFile()

Get the local baseband image file.

String getBasebandVersion()

Get the baseband version.

IDeviceBuildInfo getBaselineBuild()
File getBootloaderImageFile()

Get the local bootloader image file.

String getBootloaderVersion()

Get the bootloader version.

Map<String, String> getBuildAttributes()

Get a set of name-value pairs of additional attributes describing the build.

String getBuildBranch()

Optional method to return the source control branch that the build being tested was produced from.

String getBuildFlavor()

Optional method to return the type of build being tested.

String getBuildId()

Returns the unique identifier of build under test.

String getBuildTargetName()

Return complete name for the build being tested.

String getDeviceBuildFlavor()

Optional method to return the type of the platform build being tested.

String getDeviceBuildId()

Returns the unique identifier of platform build under test.

File getDeviceImageFile()

Get the local device image zip file.

String getDeviceImageVersion()

Get the local device image zip version.

String getDeviceSerial()

File getFile(String name)

Helper method to retrieve a file with given name.

Collection<VersionedFile> getFiles()

Returns all VersionedFiles stored in this BuildInfo.

File getMkbootimgFile()

Gets the mkbootimg file used to create the kernel image.

String getMkbootimgVersion()

Gets the mkbootimg version.

IDeviceBuildInfo getOtaBuild()
File getOtaPackageFile()

Get the device OTA package zip file.

String getOtaPackageVersion()

Get the device OTA package zip version.

File getRamdiskFile()

Gets the ramdisk file used to create the kernel image.

String getRamdiskVersion()

Gets the ramdisk version.

String getTestTag()

Return a unique name for the tests being run.

File getTestsDir()

Get the local path to the extracted tests.zip file contents.

String getTestsDirVersion()

Get the extracted tests.zip version.

File getUserDataImageFile()

Get the local test userdata image file.

String getUserDataImageVersion()

Get the local test userdata image version.

String getVersion(String name)

Helper method to retrieve a file version with given name.

void setBasebandImage(File basebandFile, String version)

Set the baseband image for the device build.

void setBaselineBuild(IDeviceBuildInfo baselineBuild)
void setBootloaderImageFile(File bootloaderImgFile, String version)

Set the bootloader image for the device build.

void setBuildBranch(String branch)

Set the build branch

void setBuildFlavor(String buildFlavor)

Set the build flavor.

void setBuildId(String buildId)

Sets the unique identifier of build under test.

void setDeviceImageFile(File deviceImageFile, String version)

Set the device system image file to use.

void setDeviceSerial(String serial)

Set the ITestDevice serial associated with this build.

void setFile(String name, File file, String version)

Stores an file with given name in this build info.

void setMkbootimgFile(File mkbootimg, String version)

Sets the mkbootimg file used to create the kernel image.

void setOtaBuild(IDeviceBuildInfo otaBuild)
void setOtaPackageFile(File otaFile, String version)

Set the device OTA package zip file.

void setRamdiskFile(File ramdisk, String version)

Gets the ramdisk file used to create the kernel image.

void setReportTargetBuild(boolean downgrade)
void setTestTag(String testTag)

Sets the unique name for the tests being run.

void setTestsDir(File testsZipFile, String version)

Set local path to the extracted tests.zip file contents.

void setUserDataImageFile(File userDataFile, String version)

Set the user data image file to use.

Protected methods

IDeviceBuildInfo getReportedBuild()

Fields

mBaselineBuild

IDeviceBuildInfo mBaselineBuild

mOtaBuild

IDeviceBuildInfo mOtaBuild

mReportTargetBuild

boolean mReportTargetBuild

Public constructors

OtaDeviceBuildInfo

OtaDeviceBuildInfo ()

Public methods

addBuildAttribute

void addBuildAttribute (String attributeName, 
                String attributeValue)

Add a build attribute

Parameters
attributeName String: the unique attribute name

attributeValue String: the attribute value

cleanUp

void cleanUp ()

Removes all temporary files.

clone

IBuildInfo clone ()

Returns
IBuildInfo

getBasebandImageFile

File getBasebandImageFile ()

Get the local baseband image file.

Returns
File

getBasebandVersion

String getBasebandVersion ()

Get the baseband version.

Returns
String

getBaselineBuild

IDeviceBuildInfo getBaselineBuild ()

Returns
IDeviceBuildInfo

getBootloaderImageFile

File getBootloaderImageFile ()

Get the local bootloader image file.

Returns
File

getBootloaderVersion

String getBootloaderVersion ()

Get the bootloader version.

Returns
String

getBuildAttributes

Map<String, String> getBuildAttributes ()

Get a set of name-value pairs of additional attributes describing the build.

Returns
Map<String, String> a Map of build attributes. Will not be null, but may be empty.

getBuildBranch

String getBuildBranch ()

Optional method to return the source control branch that the build being tested was produced from.

Returns
String the build branch or null if unset/not applicable

getBuildFlavor

String getBuildFlavor ()

Optional method to return the type of build being tested.

A common implementation for Android platform builds is to return (build product)-(build os)-(build variant). ie generic-linux-userdebug

Returns
String the build flavor or null if unset/not applicable

getBuildId

String getBuildId ()

Returns the unique identifier of build under test. Should never be null. Defaults to UNKNOWN_BUILD_ID.

Returns
String

getBuildTargetName

String getBuildTargetName ()

Return complete name for the build being tested.

A common implementation is to construct the build target name from a combination of the build flavor and branch name. [ie (branch name)-(build flavor)]

Returns
String

getDeviceBuildFlavor

String getDeviceBuildFlavor ()

Optional method to return the type of the platform build being tested.

Returns
String

getDeviceBuildId

String getDeviceBuildId ()

Returns the unique identifier of platform build under test. Should never be null. Defaults to UNKNOWN_BUILD_ID.

Returns
String

getDeviceImageFile

File getDeviceImageFile ()

Get the local device image zip file.

Returns
File

getDeviceImageVersion

String getDeviceImageVersion ()

Get the local device image zip version.

Returns
String

getDeviceSerial

String getDeviceSerial ()

Returns
String

getFile

File getFile (String name)

Helper method to retrieve a file with given name.

Returns
File the image file or null if not found

getFiles

Collection<VersionedFile> getFiles ()

Returns all VersionedFiles stored in this BuildInfo.

Returns
Collection<VersionedFile>

getMkbootimgFile

File getMkbootimgFile ()

Gets the mkbootimg file used to create the kernel image.

Returns
File

getMkbootimgVersion

String getMkbootimgVersion ()

Gets the mkbootimg version.

Returns
String

getOtaBuild

IDeviceBuildInfo getOtaBuild ()

Returns
IDeviceBuildInfo

getOtaPackageFile

File getOtaPackageFile ()

Get the device OTA package zip file.

Returns
File

getOtaPackageVersion

String getOtaPackageVersion ()

Get the device OTA package zip version.

Returns
String

getRamdiskFile

File getRamdiskFile ()

Gets the ramdisk file used to create the kernel image.

Returns
File

getRamdiskVersion

String getRamdiskVersion ()

Gets the ramdisk version.

Returns
String

getTestTag

String getTestTag ()

Return a unique name for the tests being run.

Returns
String

getTestsDir

File getTestsDir ()

Get the local path to the extracted tests.zip file contents.

Returns
File

getTestsDirVersion

String getTestsDirVersion ()

Get the extracted tests.zip version.

Returns
String

getUserDataImageFile

File getUserDataImageFile ()

Get the local test userdata image file.

Returns
File

getUserDataImageVersion

String getUserDataImageVersion ()

Get the local test userdata image version.

Returns
String

getVersion

String getVersion (String name)

Helper method to retrieve a file version with given name.

Returns
String the image version or null if not found

setBasebandImage

void setBasebandImage (File basebandFile, 
                String version)

Set the baseband image for the device build.

Parameters
basebandFile File: the baseband image File

version String: the version of the baseband

setBaselineBuild

void setBaselineBuild (IDeviceBuildInfo baselineBuild)

Parameters
baselineBuild IDeviceBuildInfo

setBootloaderImageFile

void setBootloaderImageFile (File bootloaderImgFile, 
                String version)

Set the bootloader image for the device build.

Parameters
bootloaderImgFile File: the bootloader image File

version String: the version of the bootloader

setBuildBranch

void setBuildBranch (String branch)

Set the build branch

Parameters
branch String: the branch name

setBuildFlavor

void setBuildFlavor (String buildFlavor)

Set the build flavor.

setBuildId

void setBuildId (String buildId)

Sets the unique identifier of build under test. Should never be null.

Parameters
buildId String

setDeviceImageFile

void setDeviceImageFile (File deviceImageFile, 
                String version)

Set the device system image file to use.

Parameters
version String

setDeviceSerial

void setDeviceSerial (String serial)

Set the ITestDevice serial associated with this build.

Parameters
serial String: the serial number of the ITestDevice that this build was executed with.

setFile

void setFile (String name, 
                File file, 
                String version)

Stores an file with given name in this build info.

Parameters
name String: the unique name of the file

file File: the local File

version String: the file version

setMkbootimgFile

void setMkbootimgFile (File mkbootimg, 
                String version)

Sets the mkbootimg file used to create the kernel image.

Parameters
mkbootimg File

version String

setOtaBuild

void setOtaBuild (IDeviceBuildInfo otaBuild)

Parameters
otaBuild IDeviceBuildInfo

setOtaPackageFile

void setOtaPackageFile (File otaFile, 
                String version)

Set the device OTA package zip file.

Parameters
otaFile File

version String

setRamdiskFile

void setRamdiskFile (File ramdisk, 
                String version)

Gets the ramdisk file used to create the kernel image.

Parameters
ramdisk File

version String

setReportTargetBuild

void setReportTargetBuild (boolean downgrade)

Parameters
downgrade boolean

setTestTag

void setTestTag (String testTag)

Sets the unique name for the tests being run.

Parameters
testTag String

setTestsDir

void setTestsDir (File testsZipFile, 
                String version)

Set local path to the extracted tests.zip file contents.

Parameters
version String

setUserDataImageFile

void setUserDataImageFile (File userDataFile, 
                String version)

Set the user data image file to use.

Parameters
version String

Protected methods

getReportedBuild

IDeviceBuildInfo getReportedBuild ()

Returns
IDeviceBuildInfo