public class DeviceController extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
DeviceController.Environment |
protected static class |
DeviceController.InstallReceiver |
static class |
DeviceController.PackageManagerNotReadyException |
protected static class |
DeviceController.RedirectToLogShellOutputReceiver |
protected static class |
DeviceController.SyncProgressMonitorImpl |
| Modifier and Type | Field and Description |
|---|---|
static org.echocat.jomon.runtime.util.Duration |
DISPLAY_COUNTDOWN_AFTER |
| Constructor and Description |
|---|
DeviceController() |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
cleanupConsoleIfNeeded(DeviceController.Environment environment,
AtomicInteger writtenToConsole) |
boolean |
containsPackage(DeviceController.Environment environment,
String packageName) |
protected boolean |
containsPackageManagerNotReady(String output) |
protected boolean |
containsPackageUnchecked(DeviceController.Environment environment,
String packageName) |
void |
deleteRemoveFile(DeviceController.Environment environment,
String remoteFilePath) |
static DeviceController |
deviceController() |
protected void |
displayCountdownIfNeeded(DeviceController.Environment environment,
org.echocat.jomon.runtime.concurrent.StopWatch stopWatch,
AtomicInteger cleanupConsoleLength,
String message) |
void |
exec(DeviceController.Environment environment,
String command) |
void |
exec(DeviceController.Environment environment,
String command,
com.android.ddmlib.IShellOutputReceiver receiver) |
protected <T> T |
executePackageMangerActionWithRetry(DeviceController.Environment environment,
Callable<T> what,
AtomicInteger writtenToConsole) |
protected <T> T |
executeWithRetry(DeviceController.Environment environment,
Callable<T> what,
String messageIfTakingTooLong,
AtomicInteger writtenToConsole,
Class<? extends Exception>... exceptionsThatForceRetry) |
protected com.android.ddmlib.IShellOutputReceiver |
getDefaultShellOutputReceiver(DeviceController.Environment environment) |
protected DeviceController.InstallReceiver |
getInstallReceiver(DeviceController.Environment environment) |
static DeviceController |
getInstance() |
protected DeviceController.SyncProgressMonitorImpl |
getSyncProgressMonitor(DeviceController.Environment environment,
String from) |
void |
installLocalFile(DeviceController.Environment environment,
File localFile,
String packageName,
boolean reinstall) |
void |
installRemoteFile(DeviceController.Environment environment,
String remoteFile,
String packageName,
boolean reinstall) |
protected void |
installRemoteFile(DeviceController.Environment environment,
String remoteFile,
String fileDisplay,
String packageName,
boolean reinstall) |
protected void |
installRemoteFileUnchecked(DeviceController.Environment environment,
String remoteFile,
String packageName,
boolean reinstall) |
protected org.echocat.jomon.runtime.util.Duration |
leftCommandTimeoutFor(DeviceController.Environment environment,
org.echocat.jomon.runtime.concurrent.StopWatch stopWatch) |
protected boolean |
shouldDisplayCountdownFor(org.echocat.jomon.runtime.concurrent.StopWatch stopWatch) |
void |
transferLocalFile(DeviceController.Environment environment,
File localFile,
String remoteFile) |
void |
uninstallPackage(DeviceController.Environment environment,
String packageName) |
protected void |
uninstallPackageUnchecked(DeviceController.Environment environment,
String packageName) |
protected static void |
write(DeviceController.Environment environment,
AtomicInteger writtenToConsole,
String message) |
@Nonnull public static final org.echocat.jomon.runtime.util.Duration DISPLAY_COUNTDOWN_AFTER
@Nonnull public static DeviceController getInstance()
@Nonnull public static DeviceController deviceController()
public void transferLocalFile(@Nonnull DeviceController.Environment environment, @Nonnull File localFile, @Nonnull String remoteFile) throws IOException, com.android.ddmlib.TimeoutException, com.android.ddmlib.SyncException
IOExceptioncom.android.ddmlib.TimeoutExceptioncom.android.ddmlib.SyncExceptionpublic void installLocalFile(@Nonnull DeviceController.Environment environment, @Nonnull File localFile, @Nonnull String packageName, boolean reinstall) throws IOException, com.android.ddmlib.SyncException, com.android.ddmlib.InstallException, com.android.ddmlib.TimeoutException
IOExceptioncom.android.ddmlib.SyncExceptioncom.android.ddmlib.InstallExceptioncom.android.ddmlib.TimeoutExceptionpublic void installRemoteFile(@Nonnull DeviceController.Environment environment, @Nonnull String remoteFile, @Nonnull String packageName, boolean reinstall) throws com.android.ddmlib.InstallException, com.android.ddmlib.TimeoutException, IOException
com.android.ddmlib.InstallExceptioncom.android.ddmlib.TimeoutExceptionIOException@Nullable protected <T> T executeWithRetry(@Nonnull DeviceController.Environment environment, @Nonnull Callable<T> what, @Nonnull String messageIfTakingTooLong, @Nonnull AtomicInteger writtenToConsole, @Nullable Class<? extends Exception>... exceptionsThatForceRetry) throws Exception
Exception@Nullable protected <T> T executePackageMangerActionWithRetry(@Nonnull DeviceController.Environment environment, @Nonnull Callable<T> what, @Nonnull AtomicInteger writtenToConsole) throws Exception
Exceptionprotected void installRemoteFile(@Nonnull DeviceController.Environment environment, @Nonnull String remoteFile, @Nonnull String fileDisplay, @Nonnull String packageName, boolean reinstall) throws com.android.ddmlib.InstallException, com.android.ddmlib.TimeoutException, IOException
com.android.ddmlib.InstallExceptioncom.android.ddmlib.TimeoutExceptionIOExceptionprotected void installRemoteFileUnchecked(@Nonnull DeviceController.Environment environment, @Nonnull String remoteFile, @Nonnull String packageName, boolean reinstall) throws com.android.ddmlib.TimeoutException, IOException, com.android.ddmlib.InstallException
com.android.ddmlib.TimeoutExceptionIOExceptioncom.android.ddmlib.InstallExceptionprotected boolean containsPackageManagerNotReady(@Nullable String output)
public boolean containsPackage(@Nonnull DeviceController.Environment environment, @Nonnull String packageName) throws com.android.ddmlib.TimeoutException, com.android.ddmlib.InstallException, IOException
com.android.ddmlib.TimeoutExceptioncom.android.ddmlib.InstallExceptionIOExceptionprotected boolean containsPackageUnchecked(DeviceController.Environment environment, String packageName) throws com.android.ddmlib.TimeoutException, IOException, com.android.ddmlib.InstallException
com.android.ddmlib.TimeoutExceptionIOExceptioncom.android.ddmlib.InstallExceptionpublic void uninstallPackage(@Nonnull DeviceController.Environment environment, @Nonnull String packageName) throws com.android.ddmlib.TimeoutException, com.android.ddmlib.InstallException, IOException
com.android.ddmlib.TimeoutExceptioncom.android.ddmlib.InstallExceptionIOExceptionprotected void uninstallPackageUnchecked(@Nonnull DeviceController.Environment environment, @Nonnull String packageName) throws com.android.ddmlib.TimeoutException, IOException, com.android.ddmlib.InstallException
com.android.ddmlib.TimeoutExceptionIOExceptioncom.android.ddmlib.InstallExceptionpublic void exec(@Nonnull DeviceController.Environment environment, @Nonnull String command, @Nullable com.android.ddmlib.IShellOutputReceiver receiver) throws com.android.ddmlib.TimeoutException, com.android.ddmlib.AdbCommandRejectedException, com.android.ddmlib.ShellCommandUnresponsiveException, IOException
com.android.ddmlib.TimeoutExceptioncom.android.ddmlib.AdbCommandRejectedExceptioncom.android.ddmlib.ShellCommandUnresponsiveExceptionIOExceptionpublic void exec(@Nonnull DeviceController.Environment environment, @Nonnull String command) throws com.android.ddmlib.TimeoutException, com.android.ddmlib.AdbCommandRejectedException, com.android.ddmlib.ShellCommandUnresponsiveException, IOException
com.android.ddmlib.TimeoutExceptioncom.android.ddmlib.AdbCommandRejectedExceptioncom.android.ddmlib.ShellCommandUnresponsiveExceptionIOExceptionpublic void deleteRemoveFile(@Nonnull DeviceController.Environment environment, @Nonnull String remoteFilePath) throws com.android.ddmlib.SyncException, com.android.ddmlib.TimeoutException, IOException
com.android.ddmlib.SyncExceptioncom.android.ddmlib.TimeoutExceptionIOExceptionprotected static void write(@Nonnull DeviceController.Environment environment, @Nonnull AtomicInteger writtenToConsole, @Nonnull String message) throws IOException
IOExceptionprotected static void cleanupConsoleIfNeeded(@Nonnull DeviceController.Environment environment, @Nonnull AtomicInteger writtenToConsole) throws IOException
IOExceptionprotected void displayCountdownIfNeeded(@Nonnull DeviceController.Environment environment, @Nonnull org.echocat.jomon.runtime.concurrent.StopWatch stopWatch, @Nonnull AtomicInteger cleanupConsoleLength, @Nonnull String message) throws IOException
IOException@Nonnull protected org.echocat.jomon.runtime.util.Duration leftCommandTimeoutFor(@Nonnull DeviceController.Environment environment, @Nonnull org.echocat.jomon.runtime.concurrent.StopWatch stopWatch)
protected boolean shouldDisplayCountdownFor(@Nonnull org.echocat.jomon.runtime.concurrent.StopWatch stopWatch)
@Nonnull protected DeviceController.SyncProgressMonitorImpl getSyncProgressMonitor(@Nonnull DeviceController.Environment environment, @Nonnull String from)
@Nonnull protected com.android.ddmlib.IShellOutputReceiver getDefaultShellOutputReceiver(@Nonnull DeviceController.Environment environment)
@Nonnull protected DeviceController.InstallReceiver getInstallReceiver(@Nonnull DeviceController.Environment environment)
Copyright © 2016 echocat. All rights reserved.