public class

BackgroundDeviceAction

extends Thread
java.lang.Object
   ↳ java.lang.Thread
     ↳ com.android.tradefed.device.BackgroundDeviceAction

Class Overview

Runs a command on a given device repeating as necessary until the action is canceled.

When the class is run, the command is run on the device in a separate thread and the output is collected in a temporary host file.

This is done so:

  • if device goes permanently offline during a test, the log data is retained.
  • to capture more data than may fit in device's circular log.

Summary

[Expand]
Inherited Constants
From class java.lang.Thread
Public Constructors
BackgroundDeviceAction(String command, String descriptor, ITestDevice device, IShellOutputReceiver receiver, int startDelay)
Public Methods
synchronized void cancel()
Cancels the command.
synchronized boolean isCancelled()
If the command is cancelled.
void run()

Repeats the command until canceled.

[Expand]
Inherited Methods
From class java.lang.Thread
From class java.lang.Object
From interface java.lang.Runnable

Public Constructors

public BackgroundDeviceAction (String command, String descriptor, ITestDevice device, IShellOutputReceiver receiver, int startDelay)

Parameters
command the command to run
descriptor the description of the command. For logging only.
device the device to run the command on
receiver the receiver for collecting the output of the command
startDelay the delay to wait after the device becomes online

Public Methods

public synchronized void cancel ()

Cancels the command.

public synchronized boolean isCancelled ()

If the command is cancelled.

public void run ()

Repeats the command until canceled.