DeviceLaunchControlProvider

public class DeviceLaunchControlProvider
extends LaunchControlProvider implements IDeviceBuildProvider

java.lang.Object
   ↳ com.google.android.tradefed.build.LaunchControlProvider
     ↳ com.google.android.tradefed.build.DeviceLaunchControlProvider


A LaunchControlProvider for IDeviceBuildInfo

Summary

Public constructors

DeviceLaunchControlProvider()

Public methods

void addDownloadKey(RemoteBuildInfo.BuildAttributeKey attrKey)

Require downloading a file with a given BuildAttributeKey.

void cleanUp(IBuildInfo info)

Clean up any temporary build files.

static Set<String> discoverDependencies(IConfiguration config)

Discover dependencies of the configuration.

void evaluateDeviceImageChanges(RemoteBuildInfo remoteBuild, IFileDownloader downloader, IDeviceBuildInfo localBuild)

Download required piece to evaluate whether device image changed or not.

IBuildInfo getBuild(ITestDevice device)

Retrieve the data for build under test

ITestDevice getDevice()
static String getPathForPattern(RemoteBuildInfo buildInfo, String pattern, boolean ignoreSubdir)

Help method to get remote path for images from RemoteBuildInfo

static String getPathForPattern(RemoteBuildInfo buildInfo, String pattern)

Help method to get remote path for images from RemoteBuildInfo

RemoteBuildInfo getRemoteBuild()

Get the launch control response without downloading all the files.

Set<String> reportTestZipFileFilter()
void setAltStaticDeviceInfoClass(String altStaticDeviceInfoClass)
void setBootstrapBuildInfo(boolean bootstrapBuildInfo)

Exposed for testing

boolean shouldAutopopulateFilters()
void skipDownload(RemoteBuildInfo.BuildAttributeKey attrKey)

Skip downloading a file with a given BuildAttributeKey.

Protected methods

void convertBuildToSigned(RemoteBuildInfo remoteBuild)

Modify parameters in this RemoteBuildInfo to describe a signed build.

IBuildInfo downloadBuildFiles(RemoteBuildInfo remoteBuild, String testTargetName, String buildName, IFileDownloader downloader)

Download the necessary file keys as configured in --download-build-key from the remoteBuild, and store them in a IBuildInfo.

void resolveBuildInfoFromDevice(ITestDevice device)

Gets build id, flavor from device and fetches branch information from build server

void setDevice(ITestDevice device)

Public constructors

DeviceLaunchControlProvider

public DeviceLaunchControlProvider ()

Public methods

addDownloadKey

public void addDownloadKey (RemoteBuildInfo.BuildAttributeKey attrKey)

Require downloading a file with a given BuildAttributeKey. Note that exclusions preempt inclusions, so if a file is in the skip list, it won't be downloaded, even if it's mentioned here.

Parameters
attrKey RemoteBuildInfo.BuildAttributeKey

cleanUp

public void cleanUp (IBuildInfo info)

Clean up any temporary build files.

Parameters
info IBuildInfo

discoverDependencies

public static Set<String> discoverDependencies (IConfiguration config)

Discover dependencies of the configuration.

Parameters
config IConfiguration

Returns
Set<String>

evaluateDeviceImageChanges

public void evaluateDeviceImageChanges (RemoteBuildInfo remoteBuild, 
                IFileDownloader downloader, 
                IDeviceBuildInfo localBuild)

Download required piece to evaluate whether device image changed or not.

Parameters
remoteBuild RemoteBuildInfo

downloader IFileDownloader

localBuild IDeviceBuildInfo

getBuild

public IBuildInfo getBuild (ITestDevice device)

Retrieve the data for build under test

Parameters
device ITestDevice: the ITestDevice allocated for test

Returns
IBuildInfo the IBuildInfo for build under test or null if no build is available for testing

Throws
BuildRetrievalError
DeviceNotAvailableException

getDevice

public ITestDevice getDevice ()

Returns
ITestDevice

getPathForPattern

public static String getPathForPattern (RemoteBuildInfo buildInfo, 
                String pattern, 
                boolean ignoreSubdir)

Help method to get remote path for images from RemoteBuildInfo

Parameters
buildInfo RemoteBuildInfo: a RemoteBuildInfo

pattern String: the pattern of the remote path for the image

ignoreSubdir boolean: if true, ignore the subdir in the pattern

Returns
String the remote path

getPathForPattern

public static String getPathForPattern (RemoteBuildInfo buildInfo, 
                String pattern)

Help method to get remote path for images from RemoteBuildInfo

Parameters
buildInfo RemoteBuildInfo: a RemoteBuildInfo

pattern String: the pattern of the remote path for the image

Returns
String the remote path

getRemoteBuild

public RemoteBuildInfo getRemoteBuild ()

Get the launch control response without downloading all the files.

Made public so specializations outside of this package can use it directly. Normally getBuild() should be used instead.

Returns
RemoteBuildInfo the RemoteBuildInfo response from launch control

Throws
BuildRetrievalError

reportTestZipFileFilter

public Set<String> reportTestZipFileFilter ()

Returns
Set<String>

setAltStaticDeviceInfoClass

public void setAltStaticDeviceInfoClass (String altStaticDeviceInfoClass)

Parameters
altStaticDeviceInfoClass String

setBootstrapBuildInfo

public void setBootstrapBuildInfo (boolean bootstrapBuildInfo)

Exposed for testing

shouldAutopopulateFilters

public boolean shouldAutopopulateFilters ()

Returns
boolean

skipDownload

public void skipDownload (RemoteBuildInfo.BuildAttributeKey attrKey)

Skip downloading a file with a given BuildAttributeKey.

Parameters
attrKey RemoteBuildInfo.BuildAttributeKey

Protected methods

convertBuildToSigned

protected void convertBuildToSigned (RemoteBuildInfo remoteBuild)

Modify parameters in this RemoteBuildInfo to describe a signed build.

Parameters
remoteBuild RemoteBuildInfo: the RemoteBuildInfo to modify

Throws
BuildRetrievalError

downloadBuildFiles

protected IBuildInfo downloadBuildFiles (RemoteBuildInfo remoteBuild, 
                String testTargetName, 
                String buildName, 
                IFileDownloader downloader)

Download the necessary file keys as configured in --download-build-key from the remoteBuild, and store them in a IBuildInfo.

Parameters
remoteBuild RemoteBuildInfo: the launch control server response

testTargetName String: the test target name

buildName String: the name of the build, as defined by launch control

downloader IFileDownloader: the IFileDownloader to use to download build files

Returns
IBuildInfo the IBuildInfo populated with local versions of build files

Throws
BuildRetrievalError

resolveBuildInfoFromDevice

protected void resolveBuildInfoFromDevice (ITestDevice device)

Gets build id, flavor from device and fetches branch information from build server

Throws
BuildRetrievalError
DeviceNotAvailableException

setDevice

protected void setDevice (ITestDevice device)

Parameters
device ITestDevice