背景設備動作

public class BackgroundDeviceAction
extends Object

java.lang.Object
com.android.tradefed.device.BackgroundDeviceAction


在給定設備上運行命令,根據需要重複運行,直到操作被取消。

運行該類別時,該命令將在設備上的單獨執行緒中運行,並將輸出收集在臨時主機檔案中。

這樣做是這樣的:

  • 如果設備在測試過程中永久離線,則日誌資料將被保留。
  • 擷取比設備循環日誌所能容納的更多的資料。

概括

領域

public static final String BACKGROUND_DEVICE_ACTION

公共構造函數

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

建立一個BackgroundDeviceAction

公共方法

void cancel ()

取消命令。

boolean isCancelled ()

如果命令被取消。

void run ()

重複該命令直到取消。

受保護的方法

void waitForDeviceRecovery (String exceptionType)

如果設備因任何原因離線,恢復將從主程式中觸發,因此我們只需阻塞,直到設備恢復或因設備不可用而調用失敗。

領域

背景設備操作

public static final String BACKGROUND_DEVICE_ACTION

公共構造函數

背景設備動作

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

建立一個BackgroundDeviceAction

參數
command String : 要執行的命令

descriptor String :命令的描述。僅用於記錄。

device ITestDevice :運行命令的設備

receiver IShellOutputReceiver :用於收集命令輸出的接收器

startDelay int : 設備上線後等待的延遲時間

公共方法

取消

public void cancel ()

取消命令。

取消

public boolean isCancelled ()

如果命令被取消。

退貨
boolean

跑步

public void run ()

重複該命令直到取消。

受保護的方法

等待設備恢復

protected void waitForDeviceRecovery (String exceptionType)

如果設備因任何原因離線,恢復將從主程式中觸發,因此我們只需阻塞,直到設備恢復或因設備不可用而調用失敗。