DefaultTestsZipInstaller

public class DefaultTestsZipInstaller
extends Object implements ITestsZipInstaller

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


A default implementation of tests zip installer.

Summary

Public constructors

DefaultTestsZipInstaller()

Default constructor.

DefaultTestsZipInstaller(Collection<String> skipList)

This convenience constructor allows the caller to set the skip list directly, rather than needing to call setDataWipeSkipList(String...) separately.

DefaultTestsZipInstaller(String... skipList)

This convenience constructor allows the caller to set the skip list directly, rather than needing to call setDataWipeSkipList(String...) separately.

Public methods

void deleteData(ITestDevice device)

Removes all of the files/directories from /data on the specified device, with the exception of those excluded by the skip list.

Set<String> getDataWipeSkipList()

Get the directory of directories to wipe, used for testing only.

void pushTestsZipOntoData(ITestDevice device, IDeviceBuildInfo deviceBuild)

Pushes the contents of the tests.zip file onto the device's data partition.

This implementation will reboot the device into userland before proceeding.

void setDataWipeSkipList(String... skipList)

Sets the list of paths under /data to avoid clearing.

void setDataWipeSkipList(Collection<String> skipList)

Sets the list of paths under /data to avoid clearing.

Public constructors

DefaultTestsZipInstaller

DefaultTestsZipInstaller ()

Default constructor.

DefaultTestsZipInstaller

DefaultTestsZipInstaller (Collection<String> skipList)

This convenience constructor allows the caller to set the skip list directly, rather than needing to call setDataWipeSkipList(String...) separately.

Parameters
skipList Collection: The collection of paths under /data to keep when clearing the filesystem @see #setDataWipeSkipList

DefaultTestsZipInstaller

DefaultTestsZipInstaller (String... skipList)

This convenience constructor allows the caller to set the skip list directly, rather than needing to call setDataWipeSkipList(String...) separately.

Parameters
skipList String: The collection of paths under /data to keep when clearing the filesystem @see #setDataWipeSkipList

Public methods

deleteData

void deleteData (ITestDevice device)

Removes all of the files/directories from /data on the specified device, with the exception of those excluded by the skip list.

Implementation will stop the runtime on device. It is highly recommended to reboot the device upon completion of this method.

Parameters
device ITestDevice: The ITestDevice to act on

Throws
DeviceNotAvailableException
TargetSetupError

getDataWipeSkipList

Set<String> getDataWipeSkipList ()

Get the directory of directories to wipe, used for testing only.

Returns
Set<String> the set of directories to skip when wiping a directory

pushTestsZipOntoData

void pushTestsZipOntoData (ITestDevice device, 
                IDeviceBuildInfo deviceBuild)

Pushes the contents of the tests.zip file onto the device's data partition.

This implementation will reboot the device into userland before proceeding. It will also stop the Android runtime and leave it down upon return

Parameters
device ITestDevice: the ITestDevice to flash, assumed to be in adb mode.

deviceBuild IDeviceBuildInfo: the IDeviceBuildInfo that contains the tests zip to flash

Throws
DeviceNotAvailableException
TargetSetupError

setDataWipeSkipList

void setDataWipeSkipList (String... skipList)

Sets the list of paths under /data to avoid clearing.

Parameters
skipList String: the list of directories to skip.

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

setDataWipeSkipList

void setDataWipeSkipList (Collection<String> skipList)

Sets the list of paths under /data to avoid clearing.

Parameters
skipList Collection: the list of directories to skip.

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