OtaDeviceBuildInfo

public class OtaDeviceBuildInfo
extends Object implements IDeviceBuildInfo

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


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(List<File> doNotDelete)

Version of cleanUp() where some files are not deleted.

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.

Set<IBuildInfo.BuildInfoProperties> getProperties()

Returns a copy of the properties currently set on the IBuildInfo.

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.

VersionedFile getVersionedFile(String name)

Helper method to retrieve a VersionedFile with a 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 setProperties(BuildInfoProperties... properties)

Set the IBuildInfo.BuildInfoProperties for the IBuildInfo instance.

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

protected IDeviceBuildInfo mBaselineBuild

mOtaBuild

protected IDeviceBuildInfo mOtaBuild

mReportTargetBuild

protected boolean mReportTargetBuild

Public constructors

OtaDeviceBuildInfo

public OtaDeviceBuildInfo ()

Public methods

addBuildAttribute

public void addBuildAttribute (String attributeName, 
                String attributeValue)

Add a build attribute

Parameters
attributeName String: the unique attribute name

attributeValue String: the attribute value

cleanUp

public void cleanUp (List<File> doNotDelete)

Version of cleanUp() where some files are not deleted.

Parameters
doNotDelete List

cleanUp

public void cleanUp ()

Removes all temporary files.

clone

public IBuildInfo clone ()

Returns
IBuildInfo

getBasebandImageFile

public File getBasebandImageFile ()

Get the local baseband image file.

Returns
File

getBasebandVersion

public String getBasebandVersion ()

Get the baseband version.

Returns
String

getBaselineBuild

public IDeviceBuildInfo getBaselineBuild ()

Returns
IDeviceBuildInfo

getBootloaderImageFile

public File getBootloaderImageFile ()

Get the local bootloader image file.

Returns
File

getBootloaderVersion

public String getBootloaderVersion ()

Get the bootloader version.

Returns
String

getBuildAttributes

public 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

public 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

public 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

public String getBuildId ()

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

Returns
String

getBuildTargetName

public 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

public String getDeviceBuildFlavor ()

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

Returns
String

getDeviceBuildId

public String getDeviceBuildId ()

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

Returns
String

getDeviceImageFile

public File getDeviceImageFile ()

Get the local device image zip file.

Returns
File

getDeviceImageVersion

public String getDeviceImageVersion ()

Get the local device image zip version.

Returns
String

getDeviceSerial

public String getDeviceSerial ()

Returns
String

getFile

public File getFile (String name)

Helper method to retrieve a file with given name.

Returns
File the image file or null if not found

getFiles

public Collection<VersionedFile> getFiles ()

Returns all VersionedFiles stored in this BuildInfo.

Returns
Collection<VersionedFile>

getMkbootimgFile

public File getMkbootimgFile ()

Gets the mkbootimg file used to create the kernel image.

Returns
File

getMkbootimgVersion

public String getMkbootimgVersion ()

Gets the mkbootimg version.

Returns
String

getOtaBuild

public IDeviceBuildInfo getOtaBuild ()

Returns
IDeviceBuildInfo

getOtaPackageFile

public File getOtaPackageFile ()

Get the device OTA package zip file.

Returns
File

getOtaPackageVersion

public String getOtaPackageVersion ()

Get the device OTA package zip version.

Returns
String

getProperties

public Set<IBuildInfo.BuildInfoProperties> getProperties ()

Returns a copy of the properties currently set on the IBuildInfo.

Returns
Set<IBuildInfo.BuildInfoProperties>

getRamdiskFile

public File getRamdiskFile ()

Gets the ramdisk file used to create the kernel image.

Returns
File

getRamdiskVersion

public String getRamdiskVersion ()

Gets the ramdisk version.

Returns
String

getTestTag

public String getTestTag ()

Return a unique name for the tests being run.

Returns
String

getTestsDir

public File getTestsDir ()

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

Returns
File

getTestsDirVersion

public String getTestsDirVersion ()

Get the extracted tests.zip version.

Returns
String

getUserDataImageFile

public File getUserDataImageFile ()

Get the local test userdata image file.

Returns
File

getUserDataImageVersion

public String getUserDataImageVersion ()

Get the local test userdata image version.

Returns
String

getVersion

public String getVersion (String name)

Helper method to retrieve a file version with given name.

Returns
String the image version or null if not found

getVersionedFile

public VersionedFile getVersionedFile (String name)

Helper method to retrieve a VersionedFile with a given name.

Returns
VersionedFile The versioned file or null if not found

setBasebandImage

public 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

public void setBaselineBuild (IDeviceBuildInfo baselineBuild)

Parameters
baselineBuild IDeviceBuildInfo

setBootloaderImageFile

public 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

public void setBuildBranch (String branch)

Set the build branch

Parameters
branch String: the branch name

setBuildFlavor

public void setBuildFlavor (String buildFlavor)

Set the build flavor.

setBuildId

public void setBuildId (String buildId)

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

Parameters
buildId String

setDeviceImageFile

public void setDeviceImageFile (File deviceImageFile, 
                String version)

Set the device system image file to use.

Parameters
version String

setDeviceSerial

public 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

public 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

public void setMkbootimgFile (File mkbootimg, 
                String version)

Sets the mkbootimg file used to create the kernel image.

Parameters
mkbootimg File

version String

setOtaBuild

public void setOtaBuild (IDeviceBuildInfo otaBuild)

Parameters
otaBuild IDeviceBuildInfo

setOtaPackageFile

public void setOtaPackageFile (File otaFile, 
                String version)

Set the device OTA package zip file.

Parameters
otaFile File

version String

setProperties

public void setProperties (BuildInfoProperties... properties)

Set the IBuildInfo.BuildInfoProperties for the IBuildInfo instance. Override any existing properties set before.

Parameters
properties BuildInfoProperties: The list of properties to add.

setRamdiskFile

public void setRamdiskFile (File ramdisk, 
                String version)

Gets the ramdisk file used to create the kernel image.

Parameters
ramdisk File

version String

setReportTargetBuild

public void setReportTargetBuild (boolean downgrade)

Parameters
downgrade boolean

setTestTag

public void setTestTag (String testTag)

Sets the unique name for the tests being run.

Parameters
testTag String

setTestsDir

public void setTestsDir (File testsZipFile, 
                String version)

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

Parameters
version String

setUserDataImageFile

public void setUserDataImageFile (File userDataFile, 
                String version)

Set the user data image file to use.

Parameters
version String

Protected methods

getReportedBuild

protected IDeviceBuildInfo getReportedBuild ()

Returns
IDeviceBuildInfo