aboutsummaryrefslogtreecommitdiffstats
path: root/screenshot
diff options
context:
space:
mode:
authorXavier Ducrohet <xav@android.com>2010-07-20 17:25:36 -0700
committerXavier Ducrohet <xav@android.com>2010-07-26 10:55:08 -0700
commit9db3286c710abeb2c9478c2f95657d945a55d176 (patch)
treed3e5b901646d1c2ee6bd3990bb8da99c05eb78d3 /screenshot
parentf56173887a9f6430425c93203a8c260a73b1480a (diff)
downloadsdk-9db3286c710abeb2c9478c2f95657d945a55d176.zip
sdk-9db3286c710abeb2c9478c2f95657d945a55d176.tar.gz
sdk-9db3286c710abeb2c9478c2f95657d945a55d176.tar.bz2
Update the ddmlib api for push/pull/install
The API now throws SyncException instead of returning SyncResult. The IDevice API to install/uninstall now returns a single InstallException that encapsulate all the other ddmlib exception. Also, the recently added exceptions now don't extend IOException anymore. Change-Id: Ib334c4157a6add1882233dfaaa032aea1910eede
Diffstat (limited to 'screenshot')
-rw-r--r--screenshot/src/com/android/screenshot/Screenshot.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/screenshot/src/com/android/screenshot/Screenshot.java b/screenshot/src/com/android/screenshot/Screenshot.java
index a3fe520..930ea8e 100644
--- a/screenshot/src/com/android/screenshot/Screenshot.java
+++ b/screenshot/src/com/android/screenshot/Screenshot.java
@@ -20,6 +20,7 @@ import com.android.ddmlib.AndroidDebugBridge;
import com.android.ddmlib.IDevice;
import com.android.ddmlib.Log;
import com.android.ddmlib.RawImage;
+import com.android.ddmlib.TimeoutException;
import com.android.ddmlib.Log.ILogOutput;
import com.android.ddmlib.Log.LogLevel;
@@ -198,8 +199,10 @@ public class Screenshot {
try {
rawImage = device.getScreenshot();
- }
- catch (IOException ioe) {
+ } catch (TimeoutException e) {
+ printAndExit("Unable to get frame buffer: timeout", true /* terminate */);
+ return;
+ } catch (Exception ioe) {
printAndExit("Unable to get frame buffer: " + ioe.getMessage(), true /* terminate */);
return;
}