|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IShellEnabledDevice
An abstract device that can receive shell commands.
Method Summary | |
---|---|
void |
executeShellCommand(java.lang.String command,
IShellOutputReceiver receiver,
long maxTimeToOutputResponse,
java.util.concurrent.TimeUnit maxTimeUnits)
Executes a shell command on the device, and sends the result to a receiver. |
java.lang.String |
getName()
Returns a (humanized) name for this device. |
java.util.concurrent.Future<java.lang.String> |
getSystemProperty(java.lang.String name)
Do a potential asynchronous query for a system property. |
Method Detail |
---|
java.lang.String getName()
void executeShellCommand(java.lang.String command, IShellOutputReceiver receiver, long maxTimeToOutputResponse, java.util.concurrent.TimeUnit maxTimeUnits) throws TimeoutException, AdbCommandRejectedException, ShellCommandUnresponsiveException, java.io.IOException
ShellCommandUnresponsiveException
.
For commands like log output, a maxTimeToOutputResponse value of 0, meaning
that the method will never throw and will block until the receiver's
IShellOutputReceiver.isCancelled()
returns true
, should be
used.
command
- the shell command to executereceiver
- the IShellOutputReceiver
that will receives the output of the shell
commandmaxTimeToOutputResponse
- the maximum amount of time during which the command is allowed
to not output any response. A value of 0 means the method will wait forever
(until the receiver cancels the execution) for command output and
never throw.maxTimeUnits
- Units for non-zero maxTimeToOutputResponse
values.
TimeoutException
- in case of timeout on the connection when sending the command.
AdbCommandRejectedException
- if adb rejects the command.
ShellCommandUnresponsiveException
- in case the shell command doesn't send any output
for a period longer than maxTimeToOutputResponse.
java.io.IOException
- in case of I/O error on the connection.DdmPreferences.getTimeOut()
@NonNull java.util.concurrent.Future<java.lang.String> getSystemProperty(@NonNull java.lang.String name)
name
- the name of the value to return.
Future
which can be used to retrieve value of property. Future#get() can
return null if property can not be retrieved.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |