DeviceConcurrentUtil

public class DeviceConcurrentUtil
extends Object

java.lang.Object
com.android.tradefed.util.DeviceConcurrentUtil


包含用於並發設備端命令執行的實用方法和類

使用ERROR(/ExecutorService)運行作為ShellCommandCallable實現的命令,並使用ERROR(/#joinFuture(String,Future,long))ERROR(/ExecutorService)返回的 ERROR ERROR(/Future)同步以執行命令。

概括

嵌套類

class DeviceConcurrentUtil.ShellCommandCallable <V>

一個ERROR(/Callable)包裝了在ITestDevice上執行 shell 命令的細節。

公共方法

static <T> T joinFuture (String taskDesc, task, long timeout) joinFuture (String taskDesc, task, long timeout)

將當前線程加入task便捷方法

DeviceNotAvailableExceptionERROR(/TimeoutException)發生在執行過程中透明傳遞,其他記錄為錯誤但不作其他處理。

公共方法

加入未來

public static T joinFuture (String taskDesc, 
                 task, 
                long timeout)

將當前線程加入task便捷方法

DeviceNotAvailableExceptionERROR(/TimeoutException)發生在執行過程中透明傳遞,其他記錄為錯誤但不作其他處理。

參數
taskDesc String :用於記錄目的的任務描述

task : ERROR(/Future)表示要加入的任務

timeout long : 等待任務超時

退貨
T具有模板類型的任務的結果。

投擲
com.android.tradefed.device.DeviceNotAvailableException
超時異常
DeviceNotAvailableException