to top
public class

DefaultTestsZipInstaller

extends Object
implements ITestsZipInstaller
java.lang.Object
   ↳ com.android.tradefed.targetprep.DefaultTestsZipInstaller

Class Overview

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.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.android.tradefed.targetprep.ITestsZipInstaller

Public Constructors

public DefaultTestsZipInstaller ()

Default constructor.

public 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

public 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

public 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

public 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

public 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

public 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.

public 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.