aboutsummaryrefslogtreecommitdiffstats
path: root/ddms
diff options
context:
space:
mode:
authorXavier Ducrohet <xav@android.com>2010-08-31 10:36:01 -0700
committerXavier Ducrohet <xav@android.com>2010-08-31 10:43:23 -0700
commit0b5b3edc79c75602b269fa9a0fdca842b408c4d5 (patch)
tree24b5d551881ba1b103a755f0abf5827a6adb63d6 /ddms
parentc784afa7fda424961b9e80c3cd820c2382d793e3 (diff)
downloadsdk-0b5b3edc79c75602b269fa9a0fdca842b408c4d5.zip
sdk-0b5b3edc79c75602b269fa9a0fdca842b408c4d5.tar.gz
sdk-0b5b3edc79c75602b269fa9a0fdca842b408c4d5.tar.bz2
Make the HierarchyViewer plug-in not screw up DDMS.
The HV plug-in behaved like the standalone app and initialized the AndroidDebugBridge with no client support (even though this init is handled by DDMS) and would recreate the bridge object destroying the one created by DDMS. This completely broke DDMS. Change-Id: Ife1187c74daef69607d508aabb1f7234507a170f
Diffstat (limited to 'ddms')
-rw-r--r--ddms/libs/ddmlib/src/com/android/ddmlib/AndroidDebugBridge.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/AndroidDebugBridge.java b/ddms/libs/ddmlib/src/com/android/ddmlib/AndroidDebugBridge.java
index c62ce42..01cdf0a 100644
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/AndroidDebugBridge.java
+++ b/ddms/libs/ddmlib/src/com/android/ddmlib/AndroidDebugBridge.java
@@ -61,6 +61,7 @@ public final class AndroidDebugBridge {
private static InetSocketAddress sSocketAddr;
private static AndroidDebugBridge sThis;
+ private static boolean sInitialized = false;
private static boolean sClientSupport;
/** Full path to adb. */
@@ -173,7 +174,11 @@ public final class AndroidDebugBridge {
* @see AndroidDebugBridge#createBridge(String, boolean)
* @see DdmPreferences
*/
- public static void init(boolean clientSupport) {
+ public static synchronized void init(boolean clientSupport) {
+ if (sInitialized) {
+ throw new IllegalStateException("AndroidDebugBridge.init() has already been called.");
+ }
+ sInitialized = true;
sClientSupport = clientSupport;
// Determine port and instantiate socket address.