DeviceConcurrentUtil
public
class
DeviceConcurrentUtil
extends Object
| java.lang.Object | |
| ↳ | com.android.tradefed.util.DeviceConcurrentUtil |
Contains utility methods and classes for concurrent device side command execution
Use ExecutorService to run commands implemented as ShellCommandCallable, and use
joinFuture(String,Future,long) for synchronization against the Future as
returned by ExecutorService for the command execution.
Summary
Nested classes | |
|---|---|
class |
DeviceConcurrentUtil.ShellCommandCallable<V>
A |
Public methods | |
|---|---|
static
<T>
T
|
joinFuture(String taskDesc, Future<T> task, long timeout)
Convenience method to join current thread on the
|
Public methods
joinFuture
public static T joinFuture (String taskDesc,
Future<T> task,
long timeout)Convenience method to join current thread on the task
DeviceNotAvailableException and TimeoutException occurred during execution
are passed through transparently, others are logged as error but not otherwise handled.
| Parameters | |
|---|---|
taskDesc |
String: description of task for logging purpose |
task |
Future: Future representing the task to join |
timeout |
long: timeout for waiting on the task |
| Returns | |
|---|---|
T |
The result of the task with the template type. |
| Throws | |
|---|---|
|
com.android.tradefed.device.DeviceNotAvailableException |
|
java.util.concurrent.TimeoutException |
DeviceNotAvailableException |
|
TimeoutException |
|
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2026-06-22 UTC.