DeviceLaunchControlProvider

public class DeviceLaunchControlProvider
extends LaunchControlProvider implements IDeviceBuildProvider

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


针对 IDeviceBuildInfoLaunchControlProvider

摘要

公共构造函数

DeviceLaunchControlProvider()

公共方法

void addDownloadKey(RemoteBuildInfo.BuildAttributeKey attrKey)

需要下载具有指定 BuildAttributeKey 的文件。

void cleanUp(IBuildInfo info)

清理所有临时 build 文件。

static Set<String> discoverDependencies(IConfiguration config)

发现配置的依赖项。

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

下载所需组件,以评估设备映像是否已更改。

IBuildInfo getBuild(ITestDevice device)

检索被测 build 的数据

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

用于从 RemoteBuildInfo 获取图片远程路径的帮助方法

static String getPathForPattern(RemoteBuildInfo buildInfo, String pattern)

用于从 RemoteBuildInfo 获取图片远程路径的帮助方法

RemoteBuildInfo getRemoteBuild()

获取启动控制响应,而无需下载所有文件。

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

公开以供测试

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

跳过下载具有指定 BuildAttributeKey 的文件。

受保护的方法

void convertBuildToSigned(RemoteBuildInfo remoteBuild)

修改此 RemoteBuildInfo 中的参数以描述已签名的 build。

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

remoteBuild 下载在 --download-build-key 中配置的必要文件密钥,并将其存储在 IBuildInfo 中。

void resolveBuildInfoFromDevice(ITestDevice device)

从设备获取 build ID、build flavor,并从 build 服务器提取分支信息

void setDevice(ITestDevice device)

公共构造函数

DeviceLaunchControlProvider

public DeviceLaunchControlProvider ()

公共方法

addDownloadKey

public void addDownloadKey (RemoteBuildInfo.BuildAttributeKey attrKey)

需要下载具有指定 BuildAttributeKey 的文件。请注意,排除项优先于包含项,因此,如果某个文件位于跳过列表中,即使此处提及了该文件,也不会下载该文件。

参数
attrKey RemoteBuildInfo.BuildAttributeKey

cleanUp

public void cleanUp (IBuildInfo info)

清理所有临时 build 文件。

参数
info IBuildInfo

discoverDependencies

public static Set<String> discoverDependencies (IConfiguration config)

发现配置的依赖项。

参数
config IConfiguration

返回
Set<String>

evaluateDeviceImageChanges

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

下载所需的部分,以评估设备映像是否已更改。

参数
remoteBuild RemoteBuildInfo

downloader IFileDownloader

localBuild IDeviceBuildInfo

getBuild

public IBuildInfo getBuild (ITestDevice device)

检索被测 build 的数据

参数
device ITestDevice:为测试分配的 ITestDevice

返回
IBuildInfo 被测 build 的 IBuildInfo,如果没有可用于测试的 build,则为 null

抛出
BuildRetrievalError
DeviceNotAvailableException

getDevice

public ITestDevice getDevice ()

返回
ITestDevice

getPathForPattern

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

一种帮助方法,用于从 RemoteBuildInfo 获取图片的远程路径

参数
buildInfo RemoteBuildInfo:RemoteBuildInfo

pattern String:映像的远程路径的模式

ignoreSubdir boolean:如果为 true,则忽略模式中的子目录

返回
String 远程路径

getPathForPattern

public static String getPathForPattern (RemoteBuildInfo buildInfo, 
                String pattern)

一种帮助方法,用于从 RemoteBuildInfo 获取图片的远程路径

参数
buildInfo RemoteBuildInfo:RemoteBuildInfo

pattern String:映像的远程路径的模式

返回
String 远程路径

getRemoteBuild

public RemoteBuildInfo getRemoteBuild ()

获取启动控制响应,而无需下载所有文件。

设为公开,以便此软件包之外的专业化可以直接使用它。通常应改用 getBuild()

返回
RemoteBuildInfo 来自启动控制的 RemoteBuildInfo 响应

抛出
BuildRetrievalError

reportTestZipFileFilter

public Set<String> reportTestZipFileFilter ()

返回
Set<String>

setAltStaticDeviceInfoClass

public void setAltStaticDeviceInfoClass (String altStaticDeviceInfoClass)

参数
altStaticDeviceInfoClass String

setBootstrapBuildInfo

public void setBootstrapBuildInfo (boolean bootstrapBuildInfo)

公开以供测试

shouldAutopopulateFilters

public boolean shouldAutopopulateFilters ()

返回
boolean

skipDownload

public void skipDownload (RemoteBuildInfo.BuildAttributeKey attrKey)

跳过下载具有指定 BuildAttributeKey 的文件。

参数
attrKey RemoteBuildInfo.BuildAttributeKey

受保护的方法

convertBuildToSigned

protected void convertBuildToSigned (RemoteBuildInfo remoteBuild)

修改此 RemoteBuildInfo 中的参数以描述已签名的 build。

参数
remoteBuild RemoteBuildInfo:要修改的 RemoteBuildInfo

抛出
BuildRetrievalError

downloadBuildFiles

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

remoteBuild 下载在 --download-build-key 中配置的必要文件密钥,并将它们存储在 IBuildInfo 中。

参数
remoteBuild RemoteBuildInfo:启动控制服务器响应

testTargetName String:测试目标名称

buildName String:由启动控制定义的 build 名称

downloader IFileDownloader:用于下载 build 文件的 IFileDownloader

返回
IBuildInfo 填充了 build 文件本地版本的 IBuildInfo

抛出
BuildRetrievalError

resolveBuildInfoFromDevice

protected void resolveBuildInfoFromDevice (ITestDevice device)

从设备获取 build ID、flavor,并从 build 服务器提取分支信息

抛出
BuildRetrievalError
DeviceNotAvailableException

setDevice

protected void setDevice (ITestDevice device)

参数
device ITestDevice