设备并发实用程序

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