嵌套类 |
---|
class | ModulePusher.ModulePushError 主线模块推送期间发生致命错误。 |
公共方法 |
---|
void | installModules (ImmutableMultimap<String, File> moduleFiles, boolean factoryReset, boolean disablePackageCache) 通过 adb push 将moduleFiles 安装到设备。 |
受保护的方法 |
---|
void | checkApexActivated ( ITestDevice device, modules) checkApexActivated ( ITestDevice device, modules) 检查是否所有顶点均已激活。 |
Path | getApexPathUnderSystem ( ITestDevice device, String packageName) |
| getModulesFailToActivate ( toInstall, activatedApexes) getModulesFailToActivate ( toInstall, activatedApexes) getModulesFailToActivate ( toInstall, activatedApexes) 获取激活失败的模块。 |
String[] | getPathsOnDevice ( ITestDevice device, String packageName) 获取该包的安装文件在设备上的路径。 |
Path[] | getPreloadPaths ( ITestDevice device, File[] moduleFiles, String packageName, int apiLevel) 获取预加载包在设备上的路径。 |
ImmutableMap<String, String> | parsePackageVersionCodes (String output) 将“package:{key} versionCode:{value}”行解析为映射。 |
void | setupDevice ( ITestDevice device) 在 /system 下推送文件之前 adb root 并重新挂载设备 |
void | waitForDeviceToBeResponsive (long waitTime) |
领域
越线
public static final String LINE_BREAK
公共构造函数
模块推送器
public ModulePusher (ITestDevice device,
long waitTimeMs,
long delayWaitingTimeMs)
参数 |
---|
device | ITestDevice |
waitTimeMs | long |
delayWaitingTimeMs | long |
公共方法
安装模块
public void installModules (ImmutableMultimap<String, File> moduleFiles,
boolean factoryReset,
boolean disablePackageCache)
通过 adb push 将moduleFiles
安装到设备。
参数 |
---|
moduleFiles | ImmutableMultimap :从包名称到包文件的多重映射。在拆分情况下,基础包应该是迭代顺序中的第一个包。 |
factoryReset | boolean :是否通过恢复出厂设置重新加载。 |
disablePackageCache | boolean |
受保护的方法
检查Apex激活
protected void checkApexActivated (ITestDevice device,
modules)
检查是否所有顶点均已激活。
参数 |
---|
device | ITestDevice :正在测试中。 |
modules | |
获取系统下的ApexPath
protected Path getApexPathUnderSystem (ITestDevice device,
String packageName)
参数 |
---|
device | ITestDevice |
packageName | String |
获取模块激活失败
protected getModulesFailToActivate ( toInstall,
activatedApexes)
获取激活失败的模块。
参数 |
---|
toInstall | |
activatedApexes | :设备上活动顶点的集合 |
退货 |
---|
| 包含激活失败的输入 apex 模块的 apexinfo 的列表。 |
获取设备上的路径
protected String[] getPathsOnDevice (ITestDevice device,
String packageName)
获取该包的安装文件在设备上的路径。
参数 |
---|
device | ITestDevice :正在测试中 |
packageName | String :模块的 |
获取预加载路径
protected Path[] getPreloadPaths (ITestDevice device,
File[] moduleFiles,
String packageName,
int apiLevel)
获取预加载包在设备上的路径。
对于拆分包,返回包目录的路径,后跟文件路径。因此,在这种情况下,返回的大小始终 > 1。对于非拆分包,只需返回预加载安装文件的路径即可。
参数 |
---|
device | ITestDevice :正在测试中 |
moduleFiles | File :要安装的本地模块文件 |
packageName | String :模块的 |
apiLevel | int : 设备的 |
解析包版本代码
protected ImmutableMap<String, String> parsePackageVersionCodes (String output)
将“package:{key} versionCode:{value}”行解析为映射。
退货 |
---|
ImmutableMap<String, String> | |
设置设备
protected void setupDevice (ITestDevice device)
在 /system 下推送文件之前 adb root 并重新挂载设备
等待设备响应
protected void waitForDeviceToBeResponsive (long waitTime)
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2023-12-01。
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"没有我需要的信息"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"太复杂/步骤太多"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"内容需要更新"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻译问题"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"示例/代码问题"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"易于理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"解决了我的问题"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]