diff options
-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; |