裝置快閃記憶體準備器
public abstract class DeviceFlashPreparer
extends BaseTargetPreparer
implements IConfigurationReceiver
java.lang.Object | ||
↳ | com.android.tradefed.targetprep.BaseTargetPreparer | |
↳ | com.android.tradefed.targetprep.DeviceFlashPreparer |
一個ITargetPreparer
,可在實體 Android 硬體上閃爍圖像。
概括
公共構造函數 | |
---|---|
DeviceFlashPreparer () |
公共方法 | |
---|---|
IBuildInfo | getBuild ( TestInformation testInfo) 包裝 getBuildInfo,以便我們進行更改以針對特定場景覆蓋它。 |
boolean | isIncrementalFlashingEnabled () |
boolean | isIncrementalFlashingForceDisabled () |
void | setAllowCrossReleaseFlashing (boolean allowCrossReleaseFlashing) |
void | setAllowUnzipBaseline (boolean allowUnzipBaseline) |
void | setApplySnapshot (boolean applySnapshot) |
void | setConfiguration ( IConfiguration configuration) 注入正在使用的 |
void | setUp ( TestInformation testInfo) |
void | setUserDataFlashOption ( IDeviceFlasher.UserDataFlashOption flashOption) 設定用戶資料快閃記憶體選項 |
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 | setUseIncrementalFlashing (boolean incrementalFlashing) |
公共構造函數
裝置快閃記憶體準備器
public DeviceFlashPreparer ()
公共方法
獲取構建
public IBuildInfo getBuild (TestInformation testInfo)
包裝 getBuildInfo,以便我們進行更改以針對特定場景覆蓋它。
參數 | |
---|---|
testInfo | TestInformation |
退貨 | |
---|---|
IBuildInfo |
已啟用增量閃爍
public boolean isIncrementalFlashingEnabled ()
退貨 | |
---|---|
boolean |
isIncrementalFlashingForceDisabled
public boolean isIncrementalFlashingForceDisabled ()
退貨 | |
---|---|
boolean |
設定允許交叉釋放閃爍
public void setAllowCrossReleaseFlashing (boolean allowCrossReleaseFlashing)
參數 | |
---|---|
allowCrossReleaseFlashing | boolean |
設定AllowUnzipBaseline
public void setAllowUnzipBaseline (boolean allowUnzipBaseline)
參數 | |
---|---|
allowUnzipBaseline | boolean |
設定應用程式快照
public void setApplySnapshot (boolean applySnapshot)
參數 | |
---|---|
applySnapshot | boolean |
設定配置
public void setConfiguration (IConfiguration configuration)
注入正在使用的IConfiguration
。
參數 | |
---|---|
configuration | IConfiguration |
設定
public void setUp (TestInformation testInfo)
參數 | |
---|---|
testInfo | TestInformation |
投擲 | |
---|---|
BuildError | |
DeviceNotAvailableException | |
TargetSetupError |
設定用戶資料快閃記憶體選項
public void setUserDataFlashOption (IDeviceFlasher.UserDataFlashOption flashOption)
設定用戶資料快閃記憶體選項
拆除
public void tearDown (TestInformation testInfo, Throwable e)
參數 | |
---|---|
testInfo | TestInformation |
e | Throwable |
投擲 | |
---|---|
DeviceNotAvailableException |
受保護的方法
檢查設備產品類型
protected void checkDeviceProductType (ITestDevice device, IDeviceBuildInfo deviceBuild)
刷新前可能會進行檢查,以確保設備與建置資訊相比符合預期。
參數 | |
---|---|
device | ITestDevice :要刷新的ITestDevice 。 |
deviceBuild | IDeviceBuildInfo :用於 flash 的IDeviceBuildInfo 。 |
投擲 | |
---|---|
| com.android.tradefed.targetprep.BuildError |
| com.android.tradefed.device.DeviceNotAvailableException |
BuildError | |
DeviceNotAvailableException |
建立Flasher
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 |
setUseIncrementalFlashing
protected void setUseIncrementalFlashing (boolean incrementalFlashing)
參數 | |
---|---|
incrementalFlashing | boolean |