嵌套類 |
---|
class | ModulePusher.ModulePushError Mainline 模塊推送期間出現致命錯誤。 |
公共方法 |
---|
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) adb root 並在 /system 下推送文件之前重新掛載設備 |
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 |
受保護的方法
檢查ApexActivated
protected void checkApexActivated (ITestDevice device,
modules)
檢查是否所有頂點都已激活。
參數 |
---|
device | ITestDevice :正在測試中。 |
modules | |
getApexPathUnderSystem
protected Path getApexPathUnderSystem (ITestDevice device,
String packageName)
參數 |
---|
device | ITestDevice |
packageName | String |
getModulesFailToActivate
protected getModulesFailToActivate ( toInstall,
activatedApexes)
獲取激活失敗的模塊。
參數 |
---|
toInstall | |
activatedApexes | :設備上的活動頂點集 |
獲取設備上的路徑
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)
adb root 並在 /system 下推送文件之前重新掛載設備
等待設備響應
protected void waitForDeviceToBeResponsive (long waitTime)
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2023-03-30 (世界標準時間)。
[{
"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":"其他"
}]