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(/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