DeviceCleaner

public class DeviceCleaner
extends Object implements ITargetCleaner

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


Performs reboot or format as cleanup action after test, and optionally turns screen off

Summary

Nested classes

enum DeviceCleaner.CleanupAction

 

enum DeviceCleaner.PostCleanupAction

 

Public constructors

DeviceCleaner()

Public methods

void setUp(ITestDevice device, IBuildInfo buildInfo)

Perform the target setup for testing.

void tearDown(ITestDevice device, IBuildInfo buildInfo, Throwable e)

Perform the target cleanup/teardown after testing.

Protected methods

void clean(ITestDevice device)

Execute cleanup action followed by post cleanup action

Public constructors

DeviceCleaner

DeviceCleaner ()

Public methods

setUp

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
BuildError
DeviceNotAvailableException

tearDown

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

clean

void clean (ITestDevice device)

Execute cleanup action followed by post cleanup action

Parameters
device ITestDevice
Throws
DeviceNotAvailableException