diff options
author | Brett Chabot <brettchabot@android.com> | 2011-12-13 10:52:31 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-12-13 10:52:31 -0800 |
commit | b951d9c670d34051c070cc13beeaa3dee67d35ed (patch) | |
tree | d7bc9b534f81b915c40982f5364e514f605cfd79 /ddms/libs | |
parent | daa5a5c9200708b09983bf3852b94bb8ebab1e27 (diff) | |
parent | aa8d2759d19eb63d1c0e83bd09a541030afa359e (diff) | |
download | sdk-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.java | 3 |
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; |