BackgroundDeviceAction
public
class
BackgroundDeviceAction
extends Thread
| java.lang.Object | ||
| ↳ | java.lang.Thread | |
| ↳ | com.android.tradefed.device.BackgroundDeviceAction | |
指定されたデバイスでコマンドを実行し、アクションがキャンセルされるまで必要に応じて繰り返します。
クラスが実行されると、コマンドは別のスレッドでデバイス上で実行され、出力は 一時的なホストファイルに収集されます。
これは、次のような目的で行われます。
- テスト中にデバイスが完全にオフラインになった場合、ログデータが保持されるようにします。
- デバイスの循環ログに収まらない可能性のあるデータをキャプチャできるようにします。
概要
定数 | |
|---|---|
String |
BACKGROUND_DEVICE_ACTION
|
パブリック コンストラクタ | |
|---|---|
BackgroundDeviceAction(String command, String descriptor, ITestDevice device, IShellOutputReceiver receiver, int startDelay)
|
|
BackgroundDeviceAction(String command, String descriptor, ITestDevice device, IShellOutputReceiver receiver, int startDelay, boolean noRepetitiveLogging)
|
|
パブリック メソッド | |
|---|---|
void
|
cancel()
コマンドをキャンセルします。 |
boolean
|
isCancelled()
コマンドがキャンセルされた場合。 |
void
|
run()
キャンセルされるまでコマンドを繰り返します。 |
保護されたメソッド | |
|---|---|
void
|
waitForDeviceRecovery(String exceptionType)
なんらかの理由でデバイスがオフラインになった場合、復旧はメインからトリガーされるため、復旧するまで、またはデバイスが利用できないために呼び出しが失敗するまでブロックする必要があります。 |
定数
BACKGROUND_DEVICE_ACTION
public static final String BACKGROUND_DEVICE_ACTION
定数値: "BackgroundDeviceAction"
パブリック コンストラクタ
BackgroundDeviceAction
public BackgroundDeviceAction (String command,
String descriptor,
ITestDevice device,
IShellOutputReceiver receiver,
int startDelay)| パラメータ | |
|---|---|
command |
String |
descriptor |
String |
device |
ITestDevice |
receiver |
IShellOutputReceiver |
startDelay |
int |
BackgroundDeviceAction
public BackgroundDeviceAction (String command,
String descriptor,
ITestDevice device,
IShellOutputReceiver receiver,
int startDelay,
boolean noRepetitiveLogging)BackgroundDeviceAction を作成します。
| パラメータ | |
|---|---|
command |
String: 実行するコマンド |
descriptor |
String: コマンドの説明。ロギング専用。 |
device |
ITestDevice: コマンドを実行するデバイス |
receiver |
IShellOutputReceiver: コマンドの出力を収集するレシーバー |
startDelay |
int: デバイスがオンラインになってから待機する遅延 |
noRepetitiveLogging |
boolean: 反復ロギングを抑制するかどうか |
パブリック メソッド
キャンセル
public void cancel ()
コマンドをキャンセルします。
isCancelled
public boolean isCancelled ()
コマンドがキャンセルされた場合。
| 戻り値 | |
|---|---|
boolean |
|
run
public void run ()
キャンセルされるまでコマンドを繰り返します。
保護されたメソッド
waitForDeviceRecovery
protected void waitForDeviceRecovery (String exceptionType)
なんらかの理由でデバイスがオフラインになった場合、復旧はメイン からトリガーされるため、復旧するまで、またはデバイスが利用できないために呼び出しが失敗するまでブロックする必要があります。