裝置快閃記憶體準備器

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 setConfiguration ( IConfiguration configuration)

注入正在使用的IConfiguration

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)

建立IDeviceFlasher來使用。

long getDeviceBootWaitTime ()

取得設備啟動等待時間

IHostOptions getHostOptions ()

取得要使用的IHostOptions實例。

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

設定配置

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

取得主機選項

protected IHostOptions getHostOptions ()

取得要使用的IHostOptions實例。

暴露用於單元測試

退貨
IHostOptions

報告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