aboutsummaryrefslogtreecommitdiffstats
path: root/ddms
diff options
context:
space:
mode:
authorBrett Chabot <brettchabot@android.com>2010-07-30 18:18:32 -0700
committerBrett Chabot <brettchabot@android.com>2010-08-12 10:34:12 -0700
commited1bdd0e94569260a8063a510c62cb3ed5611043 (patch)
tree413bbde32344266c4431454fabab0c5349dac774 /ddms
parentb77fc44ce57afeb2dcc4504bf486534feb031f8c (diff)
downloadsdk-ed1bdd0e94569260a8063a510c62cb3ed5611043.zip
sdk-ed1bdd0e94569260a8063a510c62cb3ed5611043.tar.gz
sdk-ed1bdd0e94569260a8063a510c62cb3ed5611043.tar.bz2
Force disconnect of all devices when adb connection is lost.
Bug 2873317 Change-Id: Idc56be6dbd8912ee463295ddfe6f3b0bbf0b5125
Diffstat (limited to 'ddms')
-rw-r--r--ddms/libs/ddmlib/src/com/android/ddmlib/DeviceMonitor.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/DeviceMonitor.java b/ddms/libs/ddmlib/src/com/android/ddmlib/DeviceMonitor.java
index 21869af..a975cd4 100644
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/DeviceMonitor.java
+++ b/ddms/libs/ddmlib/src/com/android/ddmlib/DeviceMonitor.java
@@ -219,6 +219,20 @@ final class DeviceMonitor {
// we can safely ignore that one.
}
mMainAdbConnection = null;
+
+ // remove all devices from list
+ // because we are going to call mServer.deviceDisconnected which will acquire this
+ // lock we lock it first, so that the AndroidDebugBridge lock is always locked
+ // first.
+ synchronized (AndroidDebugBridge.getLock()) {
+ synchronized (mDevices) {
+ for (int n = mDevices.size() - 1; n >= 0; n--) {
+ Device device = mDevices.get(0);
+ removeDevice(device);
+ mServer.deviceDisconnected(device);
+ }
+ }
+ }
}
}
}