diff options
author | Brett Chabot <brettchabot@android.com> | 2010-07-30 18:18:32 -0700 |
---|---|---|
committer | Brett Chabot <brettchabot@android.com> | 2010-08-12 10:34:12 -0700 |
commit | ed1bdd0e94569260a8063a510c62cb3ed5611043 (patch) | |
tree | 413bbde32344266c4431454fabab0c5349dac774 /ddms | |
parent | b77fc44ce57afeb2dcc4504bf486534feb031f8c (diff) | |
download | sdk-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.java | 14 |
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); + } + } + } } } } |