DeviceFlashPreparer

public abstract class DeviceFlashPreparer
extends BaseTargetPreparer

java.lang.Object
   ↳ com.android.tradefed.targetprep.BaseTargetPreparer
     ↳ com.android.tradefed.targetprep.DeviceFlashPreparer


ITargetPreparer 可在實體 Android 硬體上刷新映像檔。

摘要

巢狀類別

enum DeviceFlashPreparer.EncryptionOptions

用於處理 userdata 映像檔加密的選項列舉  

公用建構函式

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)

建立要使用的 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 setSkipPostFlashFlavorCheck(boolean skipPostFlashFlavorCheck)

公用建構函式

DeviceFlashPreparer

public DeviceFlashPreparer ()

公用方法

setUp

public void setUp (TestInformation testInfo)

參數
testInfo TestInformation

擲回
BuildError
DeviceNotAvailableException
TargetSetupError

setUserDataFlashOption

public void setUserDataFlashOption (IDeviceFlasher.UserDataFlashOption flashOption)

設定 userdata-flash 選項

tearDown

public void tearDown (TestInformation testInfo, 
                Throwable e)

參數
testInfo TestInformation

e Throwable

擲回
DeviceNotAvailableException

受保護的方法

checkDeviceProductType

protected void checkDeviceProductType (ITestDevice device, 
                IDeviceBuildInfo deviceBuild)

可能會在刷新前進行檢查,確保裝置與版本資訊相符。

參數
device ITestDevice:要閃爍的 ITestDevice

deviceBuild IDeviceBuildInfo:用於閃爍的 IDeviceBuildInfo

擲回
com.android.tradefed.targetprep.BuildError
DeviceNotAvailableException
BuildError

createFlasher

protected abstract IDeviceFlasher createFlasher (ITestDevice device)

建立要使用的 IDeviceFlasher。子類別可覆寫

參數
device ITestDevice

傳回
IDeviceFlasher

擲回
DeviceNotAvailableException

getDeviceBootWaitTime

protected long getDeviceBootWaitTime ()

取得裝置啟動等待時間

傳回
long

getHostOptions

protected IHostOptions getHostOptions ()

取得要使用的 IHostOptions 例項。

公開供單元測試使用

傳回
IHostOptions

reportFlashMetrics

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