Effective in 2026, to align with our trunk stable development model and ensure platform stability for the ecosystem, we will publish source code to AOSP in Q2 and Q4. For building and contributing to AOSP, use android-latest-release. The android-latest-release manifest branch will always reference the most recent release pushed to AOSP. For more information, see Changes to AOSP.
Stay organized with collections
Save and categorize content based on your preferences.
AndroidBuildArtifactHelper
public
class
AndroidBuildArtifactHelper
extends Object
| java.lang.Object
|
| ↳ |
com.google.android.tradefed.build.AndroidBuildArtifactHelper
|
Helper class used for querying Android Build API for build artifacts.
Summary
Public methods |
RemoteBuildInfo
|
queryForBuild(Build build, String branch, String buildId, String buildFlavor, String os, String pattern, Set<String> exclusionPatterns)
Performs the actual query to fetch build artifact info, via buildartifact.list API call.
|
RemoteBuildInfo
|
queryForBuild(Build build, String branch, String buildId, String buildFlavor, String os)
|
RemoteBuildInfo
|
queryForBuildById(String branch, String buildId, String buildFlavor, String os, String pattern, Set<String> exclusionPatterns)
Query for build artifact info by branch, build id and flavor.
|
RemoteBuildInfo
|
queryForLatestBuild(String branch, String buildFlavor, String os, String pattern)
Query for build artifact info by branch and flavor: latest successful build will be used if
one exists, otherwise null will be returned
|
RemoteBuildInfo
|
queryForLatestBuild(String branch, String buildFlavor, String os)
Query for build artifact info by branch and flavor: latest successful build will be used if
one exists, otherwise null will be returned
|
Protected methods |
Build
|
getBuild(String branch, String buildId, String buildFlavor, String os)
|
List<String>
|
getBuildArtifactList(String buildId, String buildFlavor, String os, String pattern, Set<String> exclusionPatterns)
|
static
String
|
getBuildFlavor(String buildFlavor, String os)
The original purpose of this was to support targets with a "fastboot" suffix.
|
Build
|
getLatestBuild(String branch, String buildFlavor, String os)
|
RemoteBuildInfo
|
queryForBuild(String branch, String buildId, String buildFlavor, String os, String pattern, Set<String> exclusionPatterns)
|
Constants
BUILD_ATTEMPT_LATEST
public static final String BUILD_ATTEMPT_LATEST
Constant Value:
"latest"
protected static final String PLATFORM_LINUX
Constant Value:
"linux"
protected static final String PLATFORM_MAC
Constant Value:
"mac"
protected static final String PLATFORM_MAC_ARM64
Constant Value:
"mac_arm64"
Public constructors
AndroidBuildArtifactHelper
public AndroidBuildArtifactHelper (String buildEnv)
Constructor of AndroidBuildArtifactHelper.
| Parameters |
buildEnv |
String: the Build API environment to use. |
AndroidBuildArtifactHelper
public AndroidBuildArtifactHelper (String buildEnv,
boolean strictMode)
| Parameters |
buildEnv |
String |
strictMode |
boolean |
AndroidBuildArtifactHelper
public AndroidBuildArtifactHelper (String buildEnv,
boolean strictMode,
boolean throwOnQueryFailure)
| Parameters |
buildEnv |
String |
strictMode |
boolean |
throwOnQueryFailure |
boolean |
Public methods
queryForBuild
public RemoteBuildInfo queryForBuild (Build build,
String branch,
String buildId,
String buildFlavor,
String os,
String pattern,
Set<String> exclusionPatterns)
Performs the actual query to fetch build artifact info, via buildartifact.list API call.
| Parameters |
build |
Build: an optional Build metadata instance, in case a prior build.get call has
already been made to obtain build info described by the buildId and
buildFlavor; when null a new build.get will be made; when not
null, no additional checks consistent checks will be performed against
buildId and buildFlavor |
exclusionPatterns |
Set: Only applies if there are no positive patterns |
queryForBuild
public RemoteBuildInfo queryForBuild (Build build,
String branch,
String buildId,
String buildFlavor,
String os)
| Parameters |
build |
Build |
branch |
String |
buildId |
String |
buildFlavor |
String |
os |
String |
queryForBuildById
public RemoteBuildInfo queryForBuildById (String branch,
String buildId,
String buildFlavor,
String os,
String pattern,
Set<String> exclusionPatterns)
Query for build artifact info by branch, build id and flavor.
Note that branch parameter here is optional: it's for the purpose of backwards
compatibility against old launch control query format. The actual querying is done by build
id and flavor, and if a branch param is provided but conflicts with the actual branch of
build, a null response will be returned instead even if a build can be found.
| Parameters |
exclusionPatterns |
Set: Only apply if there is not positive pattern |
queryForLatestBuild
public RemoteBuildInfo queryForLatestBuild (String branch,
String buildFlavor,
String os,
String pattern)
Query for build artifact info by branch and flavor: latest successful build will be used if
one exists, otherwise null will be returned
queryForLatestBuild
public RemoteBuildInfo queryForLatestBuild (String branch,
String buildFlavor,
String os)
Query for build artifact info by branch and flavor: latest successful build will be used if
one exists, otherwise null will be returned
Protected methods
getBuild
protected Build getBuild (String branch,
String buildId,
String buildFlavor,
String os)
| Parameters |
branch |
String |
buildId |
String |
buildFlavor |
String |
os |
String |
getBuildArtifactList
protected List<String> getBuildArtifactList (String buildId,
String buildFlavor,
String os,
String pattern,
Set<String> exclusionPatterns)
| Parameters |
buildId |
String |
buildFlavor |
String |
os |
String |
pattern |
String |
exclusionPatterns |
Set |
getBuildFlavor
protected static String getBuildFlavor (String buildFlavor,
String os)
The original purpose of this was to support targets with a "fastboot" suffix. This logic is no
longer considered relevant and may be removed in the future to avoid confusion. We keep this
method for now to avoid adding an unexpected suffix to the build flavor. See (b/448820244)
| Parameters |
buildFlavor |
String |
os |
String |
getLatestBuild
protected Build getLatestBuild (String branch,
String buildFlavor,
String os)
| Parameters |
branch |
String |
buildFlavor |
String |
os |
String |
queryForBuild
protected RemoteBuildInfo queryForBuild (String branch,
String buildId,
String buildFlavor,
String os,
String pattern,
Set<String> exclusionPatterns)
| Parameters |
branch |
String |
buildId |
String |
buildFlavor |
String |
os |
String |
pattern |
String |
exclusionPatterns |
Set |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2026-06-22 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-06-22 UTC."],[],[]]