SystemUpdaterDeviceFlasher

public class SystemUpdaterDeviceFlasher
extends Object implements IDeviceFlasher

java.lang.Object
   ↳ com.android.tradefed.targetprep.SystemUpdaterDeviceFlasher


A IDeviceFlasher that relies on the system updater to install a system image bundled in a OTA update package. In particular, this implementation doesn't rely on fastboot.

Summary

Public constructors

SystemUpdaterDeviceFlasher()

Public methods

void flash(ITestDevice device, IDeviceBuildInfo deviceBuild)

Flashes build on device.

This implementation assumes the device image file returned by IDeviceBuildInfo.getDeviceImageFile() is an OTA update zip.

CommandStatus getSystemFlashingStatus()

Retrieve the command execution status for flashing primary system partitions.

IDeviceFlasher.UserDataFlashOption getUserDataFlashOption()

Gets whether the user data image should be flashed, wiped, or retained

void overrideDeviceOptions(ITestDevice device)

Override options for a device.

void setDataWipeSkipList( dataWipeSkipList)

Sets the list of paths under /data to avoid clearing when using ITestsZipInstaller

Note that the granularity of the skip list is direct children of /data.

void setFlashingResourcesRetriever(IFlashingResourcesRetriever retriever)

Sets the mechanism by which the flasher can retrieve resource files for flashing.

void setForceSystemFlash(boolean forceSystemFlash)

Sets if system should always be flashed even if running current build

void setUserDataFlashOption(IDeviceFlasher.UserDataFlashOption flashOption)

Toggles whether the user data image should be flashed, wiped, or retained

This implementation only supports IDeviceFlasher.UserDataFlashOption.TESTS_ZIP and IDeviceFlasher.UserDataFlashOption.RETAIN as a valid options

void setWipeTimeout(long timeout)

Set the timeout for wiping the data.

Public constructors

SystemUpdaterDeviceFlasher

public SystemUpdaterDeviceFlasher ()

Public methods

flash

public void flash (ITestDevice device, 
                IDeviceBuildInfo deviceBuild)

Flashes build on device.

Returns immediately after flashing is complete. Callers should wait for device to be online and available before proceeding with testing.

This implementation assumes the device image file returned by IDeviceBuildInfo.getDeviceImageFile() is an OTA update zip. It's not safe to use this updater in a context where this interpretation doesn't hold.

Parameters
device ITestDevice: the ITestDevice to flash

deviceBuild IDeviceBuildInfo: the IDeviceBuildInfo to flash

Throws
com.android.tradefed.device.DeviceNotAvailableException
com.android.tradefed.targetprep.TargetSetupError
DeviceNotAvailableException
TargetSetupError

getSystemFlashingStatus

public CommandStatus getSystemFlashingStatus ()

Retrieve the command execution status for flashing primary system partitions.

Note that if system partitions are not flashed (system already has the build to be flashed) the command status may be null

Returns
CommandStatus

getUserDataFlashOption

public IDeviceFlasher.UserDataFlashOption getUserDataFlashOption ()

Gets whether the user data image should be flashed, wiped, or retained

Returns
IDeviceFlasher.UserDataFlashOption Whether the user data image should be flashed, wiped, or retained

overrideDeviceOptions

public void overrideDeviceOptions (ITestDevice device)

Override options for a device. Used to override default option values if the defaults are not supported by a particular device.

setDataWipeSkipList

public void setDataWipeSkipList ( dataWipeSkipList)

Sets the list of paths under /data to avoid clearing when using ITestsZipInstaller

Note that the granularity of the skip list is direct children of /data.

Parameters
dataWipeSkipList

setFlashingResourcesRetriever

public void setFlashingResourcesRetriever (IFlashingResourcesRetriever retriever)

Sets the mechanism by which the flasher can retrieve resource files for flashing.

Parameters
retriever IFlashingResourcesRetriever: the IFlashingResourcesRetriever to use

setForceSystemFlash

public void setForceSystemFlash (boolean forceSystemFlash)

Sets if system should always be flashed even if running current build

setUserDataFlashOption

public void setUserDataFlashOption (IDeviceFlasher.UserDataFlashOption flashOption)

Toggles whether the user data image should be flashed, wiped, or retained

This implementation only supports IDeviceFlasher.UserDataFlashOption.TESTS_ZIP and IDeviceFlasher.UserDataFlashOption.RETAIN as a valid options

setWipeTimeout

public void setWipeTimeout (long timeout)

Set the timeout for wiping the data.

Parameters
timeout long