DeviceFlashPreparer
public abstract class DeviceFlashPreparer
extends BaseTargetPreparer
java.lang.Object | ||
↳ | com.android.tradefed.targetprep.BaseTargetPreparer | |
↳ | com.android.tradefed.targetprep.DeviceFlashPreparer |
在物理 Android 硬件上闪烁图像的ITargetPreparer
。
概括
嵌套类 | |
---|---|
enum | DeviceFlashPreparer.EncryptionOptions 处理用户数据图像加密的选项枚举 |
公共构造函数 | |
---|---|
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 |
setUserDataFlashOption
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 |
DeviceNotAvailableException | |
BuildError |
createFlasher
protected abstract IDeviceFlasher createFlasher (ITestDevice device)
创建要使用的IDeviceFlasher
。子类可以覆盖
参数 | |
---|---|
device | ITestDevice |
退货 | |
---|---|
IDeviceFlasher |
投掷 | |
---|---|
DeviceNotAvailableException |
getDeviceBootWaitTime
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 |
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2022-07-06。
[]
[]