FastbootDeviceFlasher
public class FastbootDeviceFlasher
extends Object
implements IDeviceFlasher
java.lang.Object | |
↳ | com.android.tradefed.targetprep.FastbootDeviceFlasher |
依賴 fastboot 在實體 Android 硬體上刷新映像的類別。
概括
領域 | |
---|---|
public static final String | BASEBAND_IMAGE_NAME
|
公共構造函數 | |
---|---|
FastbootDeviceFlasher () |
公共方法 | |
---|---|
void | flash ( ITestDevice device, IDeviceBuildInfo deviceBuild) 閃存是在設備上建構的。 |
CommandStatus | getSystemFlashingStatus () 檢索刷新主系統分割區的命令執行狀態。 |
IDeviceFlasher.UserDataFlashOption | getUserDataFlashOption () 取得是否應刷新、擦除或保留使用者資料映像 |
void | overrideDeviceOptions ( ITestDevice device) 覆蓋設備的選項。 |
void | preFlashOperations ( ITestDevice device, IDeviceBuildInfo deviceBuild) 所有設定操作和檢查必須在實際閃爍關鍵部分之前進行。 |
void | setDataWipeSkipList ( dataWipeSkipList) setDataWipeSkipList ( dataWipeSkipList) 設定 /data 的直接子級。 |
void | setFlashOptions ( flashOptions) setFlashOptions ( flashOptions) 設定要透過 flash/update 指令傳遞的選項清單。 |
void | setFlashingResourcesRetriever ( IFlashingResourcesRetriever retriever) 設定刷新器檢索資源文件以進行刷新的機制。 |
void | setForceSystemFlash (boolean forceSystemFlash) 設定係統是否應該始終刷新,即使運行當前版本 |
void | setIncrementalFlashing ( IncrementalImageUtil incrementalUtil) |
void | setRamdiskPartition (String ramdiskPartition) 設定虛擬磁碟分割區 |
void | setShouldFlashRamdisk (boolean shouldFlashRamdisk) 設定透過映像 zip 更新裝置後是否應刷新附加 ramdisk |
void | setUserDataFlashOption ( IDeviceFlasher.UserDataFlashOption flashOption) 切換是否應刷新、擦除或保留使用者資料映像 |
void | setWipeTimeout (long timeout) 設定擦除資料的超時時間。 |
boolean | shouldFlashRamdisk () 檢查刷新器是否設定為在透過映像 zip 更新裝置後應刷新額外的 ramdisk |
受保護的方法 | |
---|---|
void | checkAndFlashBaseband ( ITestDevice device, IDeviceBuildInfo deviceBuild) 如果需要,請在裝置上刷新基頻映像。 |
boolean | checkAndFlashBootloader ( ITestDevice device, IDeviceBuildInfo deviceBuild) 如果需要,請在裝置上刷新引導程式映像。 |
boolean | checkAndFlashSystem ( ITestDevice device, String systemBuildId, String systemBuildFlavor, IDeviceBuildInfo deviceBuild) 如果需要,請在裝置上刷新系統映像。 |
boolean | checkShouldFlashBaseband ( ITestDevice device, IDeviceBuildInfo deviceBuild) 檢查所提供設備上的基頻是否需要刷新。 |
IFlashingResourcesParser | createFlashingResourcesParser ( IDeviceBuildInfo localBuild, DeviceDescriptor descriptor) 用於建立 |
void | downloadExtraImageFiles ( IFlashingResourcesParser resourceParser, IFlashingResourcesRetriever retriever, IDeviceBuildInfo localBuild) 如果需要,允許子類別下載額外的自訂映像檔的掛鉤。 |
void | downloadFlashingResources ( ITestDevice device, IDeviceBuildInfo localBuild) 下載所需的額外閃爍圖像文件 |
String | executeFastbootCmd ( ITestDevice device, String... cmdArgs) 執行 fastboot 指令的幫助程式方法。 |
String | executeLongFastbootCmd ( ITestDevice device, String... cmdArgs) 用於執行長時間運行的 fastboot 命令的幫助程序方法。 |
String | executeLongFastbootCmd ( ITestDevice device, envVarMap, String... cmdArgs) executeLongFastbootCmd ( ITestDevice device, envVarMap, String... cmdArgs) 使用環境變數執行長時間運行的 fastboot 命令的幫助程序方法。 |
void | flashBaseband ( ITestDevice device, File basebandImageFile) 刷新給定的基頻映像並重新引導回開機載入程序 |
void | flashBootloader ( ITestDevice device, File bootloaderImageFile) 刷新給定的引導程式映像並重新啟動回到引導程式 |
void | flashExtraImages ( ITestDevice device, IDeviceBuildInfo deviceBuild) 在刷新系統並重新啟動之前,刷新任何設備特定分割區。 |
void | flashPartition ( ITestDevice device, File imgFile, String partition) 快閃記憶體裝置的單一分區 |
void | flashRamdiskIfNeeded ( ITestDevice device, IDeviceBuildInfo deviceBuild) |
void | flashSystem ( ITestDevice device, IDeviceBuildInfo deviceBuild) 在裝置上刷新系統映像。 |
void | flashUserData ( ITestDevice device, IDeviceBuildInfo deviceBuild) 裝置上的閃存用戶資料分區。 |
void | flashUserDataFromDeviceImageFile ( ITestDevice device, IDeviceBuildInfo deviceBuild) 從裝置映像檔中提取 userdata.img 並將其刷新到裝置上 |
String | getBootPartitionName () 取得該裝置快閃記憶體的啟動分區名稱。 |
String | getBootloaderFilePrefix ( ITestDevice device) 取得引導程式檔案前綴。 |
String | getCurrentSlot ( ITestDevice device) 用於檢索目前插槽的輔助方法(支援 A/B 的裝置)。 |
IFlashingResourcesRetriever | getFlashingResourcesRetriever () |
FuseUtil | getFuseUtil () |
String | getImageVersion ( ITestDevice device, String imageName) 取得裝置上目前映像版本的幫助程式方法。 |
IRunUtil | getRunUtil () 暴露進行測試。 |
void | handleUserDataFlashing ( ITestDevice device, IDeviceBuildInfo deviceBuild) 處理用戶資料/快取分區的刷新 |
boolean | hasPartition ( ITestDevice device, String partition) 檢查引導程式是否存在指定的分割區 |
void | preFlashSetup ( ITestDevice device, IDeviceBuildInfo deviceBuild) 執行所需的任何額外預閃爍設定。 |
void | setSystemBuildInfo (String systemBuildId, String systemBuildFlavor) |
void | verifyRequiredBoards ( ITestDevice device, IFlashingResourcesParser resourceParser, String deviceProductType) 驗證裝置的產品類型是否支援要快閃記憶體的版本。 |
void | wipeCache ( ITestDevice device) 擦除裝置上的快取分區。 |
void | wipePartition ( ITestDevice device, String partition) 使用“fastboot擦除<名稱>”擦除指定分區 |
領域
BASEBAND_IMAGE_NAME
public static final String BASEBAND_IMAGE_NAME
公共構造函數
FastbootDeviceFlasher
public FastbootDeviceFlasher ()
公共方法
閃光
public void flash (ITestDevice device, IDeviceBuildInfo deviceBuild)
閃存是在設備上建構的。
閃爍完成後立即返回。呼叫者應等待設備上線並可用,然後再繼續測試。參數 | |
---|---|
device | ITestDevice :要刷新的ITestDevice |
deviceBuild | IDeviceBuildInfo :要刷新的IDeviceBuildInfo |
投擲 | |
---|---|
DeviceNotAvailableException | |
TargetSetupError |
取得系統閃爍狀態
public CommandStatus getSystemFlashingStatus ()
檢索刷新主系統分割區的命令執行狀態。
請注意,如果系統分割區未刷新(系統已經有要刷新的版本),則命令狀態可能為null
退貨 | |
---|---|
CommandStatus |
取得用戶資料快閃記憶體選項
public IDeviceFlasher.UserDataFlashOption getUserDataFlashOption ()
取得是否應刷新、擦除或保留使用者資料映像
退貨 | |
---|---|
IDeviceFlasher.UserDataFlashOption | 是否應刷新、擦除或保留使用者資料映像 |
預閃操作
public void preFlashOperations (ITestDevice device, IDeviceBuildInfo deviceBuild)
所有設定操作和檢查必須在實際閃爍關鍵部分之前進行。這些操作都不會包含在並發控制的關鍵部分。
參數 | |
---|---|
device | ITestDevice :要刷新的ITestDevice |
deviceBuild | IDeviceBuildInfo :要刷新的IDeviceBuildInfo |
投擲 | |
---|---|
DeviceNotAvailableException | |
TargetSetupError |
設定資料擦除跳過列表
public void setDataWipeSkipList (dataWipeSkipList)
設定/data
下的路徑清單以避免使用ITestsZipInstaller
時被清除
/data
的直接子級。參數 | |
---|---|
dataWipeSkipList |
設定Flash選項
public void setFlashOptions (flashOptions)
設定要透過 flash/update 指令傳遞的選項清單。
setFlashingResourcesRetriever
public void setFlashingResourcesRetriever (IFlashingResourcesRetriever retriever)
設定刷新器檢索資源文件以進行刷新的機制。
參數 | |
---|---|
retriever | IFlashingResourcesRetriever :要使用的IFlashingResourcesRetriever |
設定強制系統快閃記憶體
public void setForceSystemFlash (boolean forceSystemFlash)
設定係統是否應該始終刷新,即使運行當前版本
設定增量閃爍
public void setIncrementalFlashing (IncrementalImageUtil incrementalUtil)
參數 | |
---|---|
incrementalUtil | IncrementalImageUtil |
設定虛擬磁碟分割區
public void setRamdiskPartition (String ramdiskPartition)
設定虛擬磁碟分割區
設定ShouldFlash Ramdisk
public void setShouldFlashRamdisk (boolean shouldFlashRamdisk)
設定透過映像 zip 更新裝置後是否應刷新附加 ramdisk
設定用戶資料快閃記憶體選項
public void setUserDataFlashOption (IDeviceFlasher.UserDataFlashOption flashOption)
切換是否應刷新、擦除或保留使用者資料映像
設定擦除超時
public void setWipeTimeout (long timeout)
設定擦除資料的超時時間。
參數 | |
---|---|
timeout | long |
應該Flash Ramdisk
public boolean shouldFlashRamdisk ()
檢查刷新器是否設定為在透過映像 zip 更新裝置後應刷新額外的 ramdisk
退貨 | |
---|---|
boolean |
受保護的方法
檢查AndFlash基帶
protected void checkAndFlashBaseband (ITestDevice device, IDeviceBuildInfo deviceBuild)
如果需要,請在裝置上刷新基頻映像。僅當設備上的當前版本!=所需版本時才會刷新基帶
參數 | |
---|---|
device | ITestDevice :要刷新的ITestDevice |
deviceBuild | IDeviceBuildInfo :包含要刷新的基頻映像的IDeviceBuildInfo |
投擲 | |
---|---|
DeviceNotAvailableException | 如果設備不可用 |
TargetSetupError | 如果刷基帶失敗 |
檢查AndFlashBootloader
protected boolean checkAndFlashBootloader (ITestDevice device, IDeviceBuildInfo deviceBuild)
如果需要,請在裝置上刷新引導程式映像。
只有當裝置上的目前版本!=所需版本時才會刷新引導程式。
參數 | |
---|---|
device | ITestDevice :要刷新的ITestDevice |
deviceBuild | IDeviceBuildInfo :包含要快閃記憶體的開機載入程式映像的IDeviceBuildInfo |
退貨 | |
---|---|
boolean | 如果引導程式已刷新則為true ,如果跳過則為false |
投擲 | |
---|---|
DeviceNotAvailableException | 如果設備不可用 |
TargetSetupError | 如果刷新開機引導程式失敗 |
檢查和Flash系統
protected boolean checkAndFlashSystem (ITestDevice device, String systemBuildId, String systemBuildFlavor, IDeviceBuildInfo deviceBuild)
如果需要,請在裝置上刷新系統映像。
請查看ERROR(/#shouldFlashSystem(String,String,com.android.tradefed.build.IDeviceBuildInfo))
無論選擇何種路徑,在方法執行之後設備都應該啟動到使用者空間。
參數 | |
---|---|
device | ITestDevice :要刷新的ITestDevice |
systemBuildId | String : 裝置上執行的目前建置 ID |
systemBuildFlavor | String :裝置上運行的目前建置風格 |
deviceBuild | IDeviceBuildInfo :包含要刷新的系統映像的IDeviceBuildInfo |
退貨 | |
---|---|
boolean | true 如果系統已刷新, false 如果跳過 |
投擲 | |
---|---|
DeviceNotAvailableException | 如果設備不可用 |
TargetSetupError | 如果刷新開機引導程式失敗 |
檢查ShouldFlashBaseband
protected boolean checkShouldFlashBaseband (ITestDevice device, IDeviceBuildInfo deviceBuild)
檢查所提供設備上的基頻是否需要刷新。
參數 | |
---|---|
device | ITestDevice :要檢查的ITestDevice |
deviceBuild | IDeviceBuildInfo :包含要檢查的基頻映像的IDeviceBuildInfo |
退貨 | |
---|---|
boolean |
投擲 | |
---|---|
DeviceNotAvailableException | 如果設備不可用 |
TargetSetupError | 如果刷基帶失敗 |
建立FlashingResourcesParser
protected IFlashingResourcesParser createFlashingResourcesParser (IDeviceBuildInfo localBuild, DeviceDescriptor descriptor)
用於建立IFlashingResourcesParser
工廠方法。
參數 | |
---|---|
localBuild | IDeviceBuildInfo :要解析的IDeviceBuildInfo |
descriptor | DeviceDescriptor :正在刷新的裝置的描述符。 |
退貨 | |
---|---|
IFlashingResourcesParser | 由工廠方法建立的IFlashingResourcesParser 。 |
投擲 | |
---|---|
| com.android.tradefed.targetprep.TargetSetupError |
TargetSetupError |
下載額外圖片文件
protected void downloadExtraImageFiles (IFlashingResourcesParser resourceParser, IFlashingResourcesRetriever retriever, IDeviceBuildInfo localBuild)
如果需要,允許子類別下載額外的自訂映像檔的掛鉤。
參數 | |
---|---|
resourceParser | IFlashingResourcesParser : IFlashingResourcesParser |
retriever | IFlashingResourcesRetriever : IFlashingResourcesRetriever |
localBuild | IDeviceBuildInfo : IDeviceBuildInfo |
投擲 | |
---|---|
| com.android.tradefed.targetprep.TargetSetupError |
TargetSetupError |
下載Flashing資源
protected void downloadFlashingResources (ITestDevice device, IDeviceBuildInfo localBuild)
下載所需的額外閃爍圖像文件
參數 | |
---|---|
device | ITestDevice :要下載資源的ITestDevice |
localBuild | IDeviceBuildInfo :要填入的IDeviceBuildInfo 。假設裝置映像檔已設定 |
投擲 | |
---|---|
DeviceNotAvailableException | 如果設備不可用 |
TargetSetupError | 如果檢索資源失敗 |
執行FastbootCmd
protected String executeFastbootCmd (ITestDevice device, String... cmdArgs)
執行 fastboot 指令的幫助程式方法。
參數 | |
---|---|
device | ITestDevice :要執行指令的ITestDevice |
cmdArgs | String : 提供給 fastboot 的參數 |
退貨 | |
---|---|
String | 如果非空,則將指令的 stderr 輸出字串化。否則返回 stdout 一些 fastboot 命令很奇怪,因為它們在成功的情況下將輸出轉儲到 stderr |
投擲 | |
---|---|
DeviceNotAvailableException | 如果設備不可用 |
TargetSetupError | 如果 fastboot 指令失敗 |
執行LongFastbootCmd
protected String executeLongFastbootCmd (ITestDevice device, String... cmdArgs)
用於執行長時間運行的 fastboot 命令的幫助程序方法。
注意:大多數 fastboot 指令通常在INativeDevice.executeFastbootCommand(String)
允許的逾時內執行。但是,當多個裝置同時刷新裝置時,fastboot 命令可能需要比正常情況更長的時間。
參數 | |
---|---|
device | ITestDevice :要執行指令的ITestDevice |
cmdArgs | String : 提供給 fastboot 的參數 |
退貨 | |
---|---|
String | 如果非空,則將指令的 stderr 輸出字串化。否則返回 stdout 一些 fastboot 命令很奇怪,因為它們在成功的情況下將輸出轉儲到 stderr |
投擲 | |
---|---|
DeviceNotAvailableException | 如果設備不可用 |
TargetSetupError | 如果 fastboot 指令失敗 |
執行LongFastbootCmd
protected String executeLongFastbootCmd (ITestDevice device,envVarMap, String... cmdArgs)
使用環境變數執行長時間運行的 fastboot 命令的幫助程序方法。
注意:大多數 fastboot 指令通常在INativeDevice.executeFastbootCommand(String)
允許的逾時內執行。但是,當多個裝置同時刷新裝置時,fastboot 命令可能需要比正常情況更長的時間。
參數 | |
---|---|
device | ITestDevice :要執行指令的ITestDevice |
envVarMap | |
cmdArgs | String : 提供給 fastboot 的參數 |
退貨 | |
---|---|
String | 如果非空,則將指令的 stderr 輸出字串化。否則返回 stdout 一些 fastboot 命令很奇怪,因為它們在成功的情況下將輸出轉儲到 stderr |
投擲 | |
---|---|
DeviceNotAvailableException | 如果設備不可用 |
TargetSetupError | 如果 fastboot 指令失敗 |
快閃記憶體基帶
protected void flashBaseband (ITestDevice device, File basebandImageFile)
刷新給定的基頻映像並重新引導回開機載入程序
參數 | |
---|---|
device | ITestDevice :要刷新的ITestDevice |
basebandImageFile | File :基頻影像ERROR(/File) |
投擲 | |
---|---|
DeviceNotAvailableException | 如果設備不可用 |
TargetSetupError | 如果刷基帶失敗 |
快閃記憶體引導程式
protected void flashBootloader (ITestDevice device, File bootloaderImageFile)
刷新給定的引導程式映像並重新啟動回到引導程式
參數 | |
---|---|
device | ITestDevice :要刷新的ITestDevice |
bootloaderImageFile | File :引導程式映像ERROR(/File) |
投擲 | |
---|---|
DeviceNotAvailableException | 如果設備不可用 |
TargetSetupError | 如果刷機失敗 |
閃光額外影像
protected void flashExtraImages (ITestDevice device, IDeviceBuildInfo deviceBuild)
在刷新系統並重新啟動之前,刷新任何設備特定分割區。除非被覆蓋,否則無操作。
參數 | |
---|---|
device | ITestDevice :要刷新的ITestDevice |
deviceBuild | IDeviceBuildInfo :包含建置檔案的IDeviceBuildInfo |
投擲 | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
| com.android.tradefed.targetprep.TargetSetupError |
DeviceNotAvailableException | |
TargetSetupError |
快閃記憶體分區
protected void flashPartition (ITestDevice device, File imgFile, String partition)
快閃記憶體裝置的單一分區
參數 | |
---|---|
device | ITestDevice :要刷新的ITestDevice |
imgFile | File :指向要刷新的圖像的ERROR(/File) |
partition | String : 要刷新的分割區的名稱 |
投擲 | |
---|---|
DeviceNotAvailableException | |
TargetSetupError |
閃存虛擬碟(如果需要)
protected void flashRamdiskIfNeeded (ITestDevice device, IDeviceBuildInfo deviceBuild)
參數 | |
---|---|
device | ITestDevice |
deviceBuild | IDeviceBuildInfo |
投擲 | |
---|---|
DeviceNotAvailableException | |
TargetSetupError |
快閃記憶體系統
protected void flashSystem (ITestDevice device, IDeviceBuildInfo deviceBuild)
在裝置上刷新系統映像。
參數 | |
---|---|
device | ITestDevice :要刷新的ITestDevice |
deviceBuild | IDeviceBuildInfo :要刷新的IDeviceBuildInfo |
投擲 | |
---|---|
DeviceNotAvailableException | 如果設備不可用 |
TargetSetupError | 如果 fastboot 指令失敗 |
快閃記憶體用戶數據
protected void flashUserData (ITestDevice device, IDeviceBuildInfo deviceBuild)
裝置上的閃存用戶資料分區。
參數 | |
---|---|
device | ITestDevice :要刷新的ITestDevice |
deviceBuild | IDeviceBuildInfo :包含要刷新的檔案的IDeviceBuildInfo |
投擲 | |
---|---|
DeviceNotAvailableException | 如果設備不可用 |
TargetSetupError | 如果刷新用戶資料失敗 |
flashUserDataFromDeviceImageFile
protected void flashUserDataFromDeviceImageFile (ITestDevice device, IDeviceBuildInfo deviceBuild)
從裝置映像檔中提取 userdata.img 並將其刷新到裝置上
參數 | |
---|---|
device | ITestDevice :要刷新的ITestDevice |
deviceBuild | IDeviceBuildInfo :包含要刷新的檔案的IDeviceBuildInfo |
投擲 | |
---|---|
DeviceNotAvailableException | 如果設備不可用 |
TargetSetupError | 如果無法提取或刷新用戶數據 |
取得開機分割區名稱
protected String getBootPartitionName ()
取得該裝置快閃記憶體的啟動分區名稱。
預設為“引導程式”。如有必要,子類別應重寫。
退貨 | |
---|---|
String |
取得Bootloader檔案前綴
protected String getBootloaderFilePrefix (ITestDevice device)
取得引導程式檔案前綴。
預設為getBootPartitionName()
。如有必要,子類別應重寫。參數 | |
---|---|
device | ITestDevice :要刷新的ITestDevice |
退貨 | |
---|---|
String |
投擲 | |
---|---|
DeviceNotAvailableException | 如果設備不可用 |
TargetSetupError | 如果未能取得前綴 |
取得目前插槽
protected String getCurrentSlot (ITestDevice device)
用於檢索目前插槽的輔助方法(支援 A/B 的裝置)。
參數 | |
---|---|
device | ITestDevice :要在其上執行命令的ITestDevice 。 |
退貨 | |
---|---|
String | “a”、“b”或 null(如果設備不支援 A/B) |
投擲 | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
| com.android.tradefed.targetprep.TargetSetupError |
DeviceNotAvailableException | |
TargetSetupError |
getFlashingResourcesRetriever
protected IFlashingResourcesRetriever getFlashingResourcesRetriever ()
退貨 | |
---|---|
IFlashingResourcesRetriever |
取得影像版本
protected String getImageVersion (ITestDevice device, String imageName)
取得裝置上目前映像版本的幫助程式方法。
參數 | |
---|---|
device | ITestDevice :要執行指令的ITestDevice |
imageName | String : 要取得的圖像的名稱。 |
退貨 | |
---|---|
String | 將指令的 stdout 輸出字串化 |
投擲 | |
---|---|
DeviceNotAvailableException | 如果設備不可用 |
TargetSetupError | 如果 fastboot 指令失敗或無法確定版本 |
處理用戶資料閃爍
protected void handleUserDataFlashing (ITestDevice device, IDeviceBuildInfo deviceBuild)
處理用戶資料/快取分區的刷新
參數 | |
---|---|
device | ITestDevice :要刷新的ITestDevice |
deviceBuild | IDeviceBuildInfo :包含要刷新的檔案的IDeviceBuildInfo |
投擲 | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
| com.android.tradefed.targetprep.TargetSetupError |
DeviceNotAvailableException | |
TargetSetupError |
有分區
protected boolean hasPartition (ITestDevice device, String partition)
檢查引導程式是否存在指定的分割區
參數 | |
---|---|
device | ITestDevice :要操作的ITestDevice |
partition | String : 要檢查的分區名稱 |
退貨 | |
---|---|
boolean |
投擲 | |
---|---|
DeviceNotAvailableException |
預閃光設定
protected void preFlashSetup (ITestDevice device, IDeviceBuildInfo deviceBuild)
執行所需的任何額外預閃爍設定。除非被覆蓋,否則無操作。
參數 | |
---|---|
device | ITestDevice :要準備的ITestDevice |
deviceBuild | IDeviceBuildInfo :包含建置檔案的IDeviceBuildInfo |
投擲 | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
| com.android.tradefed.targetprep.TargetSetupError |
DeviceNotAvailableException | |
TargetSetupError |
設定係統建置資訊
protected void setSystemBuildInfo (String systemBuildId, String systemBuildFlavor)
參數 | |
---|---|
systemBuildId | String |
systemBuildFlavor | String |
驗證所需板
protected void verifyRequiredBoards (ITestDevice device, IFlashingResourcesParser resourceParser, String deviceProductType)
驗證裝置的產品類型是否支援要快閃記憶體的版本。
基本實作將驗證 deviceProductType 是否包含在IFlashingResourcesParser.getRequiredBoards()
集合中。子類別可以根據需要重寫。
參數 | |
---|---|
device | ITestDevice :要刷新的ITestDevice |
resourceParser | IFlashingResourcesParser : IFlashingResourcesParser |
deviceProductType | String : device的產品類型 |
投擲 | |
---|---|
TargetSetupError | 如果建造所需的主機板資訊與設備不匹配 |
擦除快取
protected void wipeCache (ITestDevice device)
擦除裝置上的快取分區。
參數 | |
---|---|
device | ITestDevice :要刷新的ITestDevice |
投擲 | |
---|---|
DeviceNotAvailableException | 如果設備不可用 |
TargetSetupError | 如果刷新快取失敗 |
擦分區
protected void wipePartition (ITestDevice device, String partition)
使用“fastboot擦除<名稱>”擦除指定分區
參數 | |
---|---|
device | ITestDevice :要操作的ITestDevice |
partition | String : 要清除的分割區的名稱 |
投擲 | |
---|---|
DeviceNotAvailableException | |
TargetSetupError |