DeviceImageZipFlashingTargetPreparer

public class DeviceImageZipFlashingTargetPreparer
extends DeviceUpdateTargetPreparer

java.lang.Object
   ↳ com.android.tradefed.targetprep.BaseTargetPreparer
     ↳ com.android.tradefed.targetprep.DeviceBuildInfoBootStrapper
       ↳ com.android.tradefed.targetprep.DeviceUpdateTargetPreparer
         ↳ com.android.tradefed.targetprep.DeviceImageZipFlashingTargetPreparer


A target preparer that flashes the device with device images provided via a specific format.

High level requirements for the device image format:

  • Device image file must be a zip file
  • The zip file must include a flash-all.sh script at the root
  • The script must assume that the device is in userspace visible to adb devices
  • The rest of the zip file will be extracted into the same location as script with the same directory layout, and the script may make reference to any files packaged in the zip via relative path
  • After flashing, the script must return the device to the same state
  • An environment variable ANDROID_SERIAL will be set to device serial number as part of the execution environment
  • The script may assume that it has adb and fastboot on PATH
This target preparer will unpack the device image zip file and execute the enclosed flash- all.sh under the assumptions outline in requirements above.

Summary

Public constructors

DeviceImageZipFlashingTargetPreparer()

Protected methods

File getDeviceUpdateImage()

Provides a ERROR(/File) instance representing the device image file to be used for updating

void performDeviceUpdate(File deviceUpdateImage, ITestDevice device)

Expands the device image update zip and calls the enclosed flashing script

void postUpdateActions(File deviceUpdateImage, ITestDevice device)

No-op

void preUpdateActions(File deviceUpdateImage, ITestDevice device)

No-op

Public constructors

DeviceImageZipFlashingTargetPreparer

public DeviceImageZipFlashingTargetPreparer ()

Protected methods

getDeviceUpdateImage

protected File getDeviceUpdateImage ()

Provides a ERROR(/File) instance representing the device image file to be used for updating

Returns
File

performDeviceUpdate

protected void performDeviceUpdate (File deviceUpdateImage, 
                ITestDevice device)

Expands the device image update zip and calls the enclosed flashing script

Throws
DeviceNotAvailableException
TargetSetupError

postUpdateActions

protected void postUpdateActions (File deviceUpdateImage, 
                ITestDevice device)

No-op

Throws
DeviceNotAvailableException
TargetSetupError

preUpdateActions

protected void preUpdateActions (File deviceUpdateImage, 
                ITestDevice device)

No-op

Throws
DeviceNotAvailableException
TargetSetupError