aboutsummaryrefslogtreecommitdiffstats
path: root/ddms/libs
diff options
context:
space:
mode:
authorBrett Chabot <brettchabot@android.com>2011-12-13 10:52:31 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-12-13 10:52:31 -0800
commitb951d9c670d34051c070cc13beeaa3dee67d35ed (patch)
treed7bc9b534f81b915c40982f5364e514f605cfd79 /ddms/libs
parentdaa5a5c9200708b09983bf3852b94bb8ebab1e27 (diff)
parentaa8d2759d19eb63d1c0e83bd09a541030afa359e (diff)
downloadsdk-b951d9c670d34051c070cc13beeaa3dee67d35ed.zip
sdk-b951d9c670d34051c070cc13beeaa3dee67d35ed.tar.gz
sdk-b951d9c670d34051c070cc13beeaa3dee67d35ed.tar.bz2
Merge "Use a custom timeout for IDevice.getBatteryLevel."
Diffstat (limited to 'ddms/libs')
-rw-r--r--ddms/libs/ddmlib/src/com/android/ddmlib/Device.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/Device.java b/ddms/libs/ddmlib/src/com/android/ddmlib/Device.java
index 15420cd..5a3cfd1 100644
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/Device.java
+++ b/ddms/libs/ddmlib/src/com/android/ddmlib/Device.java
@@ -36,6 +36,7 @@ import java.util.regex.Pattern;
final class Device implements IDevice {
private final static int INSTALL_TIMEOUT = 2*60*1000; //2min
+ private static final int BATTERY_TIMEOUT = 2*1000; //2 seconds
/** Emulator Serial Number regexp. */
final static String RE_EMULATOR_SN = "emulator-(\\d+)"; //$NON-NLS-1$
@@ -716,7 +717,7 @@ final class Device implements IDevice {
return mLastBatteryLevel;
}
BatteryReceiver receiver = new BatteryReceiver();
- executeShellCommand("dumpsys battery", receiver);
+ executeShellCommand("dumpsys battery", receiver, BATTERY_TIMEOUT);
mLastBatteryLevel = receiver.getBatteryLevel();
mLastBatteryCheckTime = System.currentTimeMillis();
return mLastBatteryLevel;