DeviceFlashPreparer
public abstract class DeviceFlashPreparer
extends BaseTargetPreparer
java.lang.Object | ||
↳ | com.android.tradefed.targetprep.BaseTargetPreparer | |
↳ | com.android.tradefed.targetprep.DeviceFlashPreparer |
在物理 Android 硬件上閃爍圖像的ITargetPreparer
。
概括
公共構造函數 | |
---|---|
DeviceFlashPreparer () |
公共方法 | |
---|---|
void | setUp ( TestInformation testInfo) |
void | setUserDataFlashOption ( IDeviceFlasher.UserDataFlashOption flashOption) 設置 userdata-flash 選項 |
void | tearDown ( TestInformation testInfo, Throwable e) |
受保護的方法 | |
---|---|
void | checkDeviceProductType ( ITestDevice device, IDeviceBuildInfo deviceBuild) 刷機前可能會進行檢查,以確保設備與構建信息相比符合預期。 |
abstract IDeviceFlasher | createFlasher ( ITestDevice device) 創建 |
long | getDeviceBootWaitTime () 獲取設備開機等待時間 |
IHostOptions | getHostOptions () 獲取要使用的 |
void | reportFlashMetrics (String branch, String buildFlavor, String buildId, String serial, long queueTime, long flashingTime, CommandStatus flashingStatus) 向指標後端報告設備閃爍計時數據 |
void | setSkipPostFlashBuildIdCheck (boolean skipPostFlashBuildIdCheck) |
void | setSkipPostFlashFlavorCheck (boolean skipPostFlashFlavorCheck) |
公共構造函數
DeviceFlashPreparer
public DeviceFlashPreparer ()
公共方法
設置
public void setUp (TestInformation testInfo)
參數 | |
---|---|
testInfo | TestInformation |
投擲 | |
---|---|
BuildError | |
DeviceNotAvailableException | |
TargetSetupError |
設置用戶數據閃存選項
public void setUserDataFlashOption (IDeviceFlasher.UserDataFlashOption flashOption)
設置 userdata-flash 選項
拆除
public void tearDown (TestInformation testInfo, Throwable e)
參數 | |
---|---|
testInfo | TestInformation |
e | Throwable |
投擲 | |
---|---|
DeviceNotAvailableException |
受保護的方法
檢查設備產品類型
protected void checkDeviceProductType (ITestDevice device, IDeviceBuildInfo deviceBuild)
刷機前可能會進行檢查,以確保設備與構建信息相比符合預期。
參數 | |
---|---|
device | ITestDevice :要閃存的ITestDevice 。 |
deviceBuild | IDeviceBuildInfo :用於燒錄的IDeviceBuildInfo 。 |
投擲 | |
---|---|
| com.android.tradefed.targetprep.BuildError |
| com.android.tradefed.device.DeviceNotAvailableException |
BuildError | |
DeviceNotAvailableException |
創建閃光器
protected abstract IDeviceFlasher createFlasher (ITestDevice device)
創建IDeviceFlasher
以供使用。子類可以覆蓋
參數 | |
---|---|
device | ITestDevice |
退貨 | |
---|---|
IDeviceFlasher |
投擲 | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
獲取設備啟動等待時間
protected long getDeviceBootWaitTime ()
獲取設備開機等待時間
退貨 | |
---|---|
long |
報告FlashMetrics
protected void reportFlashMetrics (String branch, String buildFlavor, String buildId, String serial, long queueTime, long flashingTime, CommandStatus flashingStatus)
向指標後端報告設備閃爍計時數據
參數 | |
---|---|
branch | String :設備構建源自的分支 |
buildFlavor | String :設備構建的構建風格 |
buildId | String : 設備版本號 |
serial | String : 設備序列號 |
queueTime | long :等待閃爍限制可用的時間 |
flashingTime | long : 刷新設備映像 zip 所花費的時間 |
flashingStatus | CommandStatus : 閃爍命令的執行狀態 |
setSkipPostFlashBuildIdCheck
protected void setSkipPostFlashBuildIdCheck (boolean skipPostFlashBuildIdCheck)
參數 | |
---|---|
skipPostFlashBuildIdCheck | boolean |
setSkipPostFlashFlavorCheck
protected void setSkipPostFlashFlavorCheck (boolean skipPostFlashFlavorCheck)
參數 | |
---|---|
skipPostFlashFlavorCheck | boolean |