DeviceFlashPreparer
public
abstract
class
DeviceFlashPreparer
extends BaseTargetPreparer
implements
ITargetCleaner
java.lang.Object | ||
↳ | com.android.tradefed.targetprep.BaseTargetPreparer | |
↳ | com.android.tradefed.targetprep.DeviceFlashPreparer |
A ITargetPreparer
that flashes an image on physical Android hardware.
Summary
Nested classes | |
---|---|
enum |
DeviceFlashPreparer.EncryptionOptions
Enum of options for handling the encryption of userdata image |
Public constructors | |
---|---|
DeviceFlashPreparer()
|
Public methods | |
---|---|
void
|
setUp(ITestDevice device, IBuildInfo buildInfo)
Perform the target setup for testing. |
void
|
setUserDataFlashOption(IDeviceFlasher.UserDataFlashOption flashOption)
Set the userdata-flash option |
void
|
tearDown(ITestDevice device, IBuildInfo buildInfo, Throwable e)
Perform the target cleanup/teardown after testing. |
Protected methods | |
---|---|
void
|
checkDeviceProductType(ITestDevice device, IDeviceBuildInfo deviceBuild)
Possible check before flashing to ensure the device is as expected compare to the build info. |
abstract
IDeviceFlasher
|
createFlasher(ITestDevice device)
Create |
IHostOptions
|
getHostOptions()
Gets the |
void
|
reportFlashMetrics(String branch, String buildFlavor, String buildId, String serial, long queueTime, long flashingTime, CommandStatus flashingStatus)
Reports device flashing timing data to metrics backend |
Public constructors
DeviceFlashPreparer
public DeviceFlashPreparer ()
Public methods
setUp
public void setUp (ITestDevice device, IBuildInfo buildInfo)
Perform the target setup for testing.
Parameters | |
---|---|
device |
ITestDevice : the ITestDevice to prepare. |
buildInfo |
IBuildInfo : data about the build under test. |
Throws | |
---|---|
TargetSetupError |
|
DeviceNotAvailableException |
|
BuildError |
setUserDataFlashOption
public void setUserDataFlashOption (IDeviceFlasher.UserDataFlashOption flashOption)
Set the userdata-flash option
tearDown
public void tearDown (ITestDevice device, IBuildInfo buildInfo, Throwable e)
Perform the target cleanup/teardown after testing.
Parameters | |
---|---|
device |
ITestDevice : the ITestDevice to prepare. |
buildInfo |
IBuildInfo : data about the build under test. |
e |
Throwable : if the invocation ended with an exception, this will be the exception that was
caught at the Invocation level. Otherwise, will be null . |
Throws | |
---|---|
DeviceNotAvailableException |
Protected methods
checkDeviceProductType
protected void checkDeviceProductType (ITestDevice device, IDeviceBuildInfo deviceBuild)
Possible check before flashing to ensure the device is as expected compare to the build info.
Parameters | |
---|---|
device |
ITestDevice : the ITestDevice to flash. |
deviceBuild |
IDeviceBuildInfo : the IDeviceBuildInfo used to flash. |
Throws | |
---|---|
|
BuildError |
DeviceNotAvailableException |
|
BuildError |
createFlasher
protected abstract IDeviceFlasher createFlasher (ITestDevice device)
Create IDeviceFlasher
to use. Subclasses can override
Parameters | |
---|---|
device |
ITestDevice |
Returns | |
---|---|
IDeviceFlasher |
Throws | |
---|---|
DeviceNotAvailableException |
getHostOptions
protected IHostOptions getHostOptions ()
Gets the IHostOptions
instance to use.
Returns | |
---|---|
IHostOptions |
reportFlashMetrics
protected void reportFlashMetrics (String branch, String buildFlavor, String buildId, String serial, long queueTime, long flashingTime, CommandStatus flashingStatus)
Reports device flashing timing data to metrics backend
Parameters | |
---|---|
branch |
String : the branch where the device build originated from |
buildFlavor |
String : the build flavor of the device build |
buildId |
String : the build number of the device build |
serial |
String : the serial number of device |
queueTime |
long : the time spent waiting for a flashing limit to become available |
flashingTime |
long : the time spent in flashing device image zip |
flashingStatus |
CommandStatus : the execution status of flashing command
|
Interfaces
Classes
- AbstractTargetCleaner
- AdditionalFilesInstaller
- AllTestAppsInstallSetup
- AppSetup
- BaseTargetPreparer
- BuildInfoAttributePreparer
- BuildInfoRecorder
- CdmaDeviceFlasher
- ConnectionChecker
- CpuThrottlingWaiter
- CrashCollector
- DefaultTestsZipInstaller
- DeviceBuildInfoInjector
- DeviceCleaner
- DeviceFlashPreparer
- DeviceSetup
- DeviceStorageFiller
- DeviceStringPusher
- DeviceWiper
- EraseUserDataPreparer
- FastbootDeviceFlasher
- FileCleaner
- FlashingResourcesParser
- FlashingResourcesParser.AndroidInfo
- FolderSaver
- InstallAllTestZipAppsSetup
- InstallApkSetup
- InstallBuildEnvApkSetup
- InstrumentationPreparer
- KernelFlashPreparer
- KeyValueConfigPreparer
- LocalSdkAvdPreparer
- NativeLeakCollector
- PreloadedClassesPreparer
- PushFileInvoker
- PushFilePreparer
- PythonVirtualenvPreparer
- RebootTargetPreparer
- RemoveSystemAppPreparer
- RestartSystemServerTargetPreparer
- RootTargetPreparer
- RunCommandTargetPreparer
- RunHostCommandTargetPreparer
- SdkAvdPreparer
- StopServicesSetup
- StubTargetPreparer
- SystemUpdaterDeviceFlasher
- TearDownPassThroughPreparer
- TemperatureThrottlingWaiter
- TestAppInstallSetup
- TestFilePushSetup
- TestSystemAppInstallSetup
- TimeSetterTargetPreparer
- TimeWaster
- WaitForDeviceDatetimePreparer
- WifiPreparer
Enums
Exceptions
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.