diff options
author | Xavier Ducrohet <xav@android.com> | 2010-09-03 17:14:29 -0700 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2010-09-03 17:25:49 -0700 |
commit | 0b21937765ca5307a6a7e244ba4eddd36954b9cf (patch) | |
tree | 0158022cbfffe20f234920a61514c814d1ea59c3 /eclipse/plugins/com.android.ide.eclipse.adt | |
parent | d739049a624f4492bf292cde501af39a77b01624 (diff) | |
download | sdk-0b21937765ca5307a6a7e244ba4eddd36954b9cf.zip sdk-0b21937765ca5307a6a7e244ba4eddd36954b9cf.tar.gz sdk-0b21937765ca5307a6a7e244ba4eddd36954b9cf.tar.bz2 |
DDMS now receives the adb location through an extension point.
Previously DDMS received the adb location through a normal Java API
which requires the other plug-in to be actually running (This
was done in the the start method of ADT).
The new change allows DDMS to start a plug-in (by loading
an extension provided by the plug-in) to query for the location
of adb.
This allows us to have plug-ins with no UI able to provide
the location of ADB (ie a "platform" plug-in that has no UI
besides a pref page, that is started by DDMS indirectly).
Also cleaned up how HierarchyViewer use the AndroidDebugBridge.
Change-Id: I8e842a294eea94c06417149144a2ce435e719cfd
Diffstat (limited to 'eclipse/plugins/com.android.ide.eclipse.adt')
3 files changed, 32 insertions, 9 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/plugin.xml b/eclipse/plugins/com.android.ide.eclipse.adt/plugin.xml index bd92a97..bb30ec0 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/plugin.xml +++ b/eclipse/plugins/com.android.ide.eclipse.adt/plugin.xml @@ -765,4 +765,10 @@ id="com.android.ide.eclipse.adt.AndroidJUnitPropertyTester"> </propertyTester> </extension> + <extension + point="com.android.ide.eclipse.ddms.adbLocator"> + <locator + class="com.android.ide.eclipse.adt.AdbLocator"> + </locator> + </extension> </plugin> diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdbLocator.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdbLocator.java new file mode 100644 index 0000000..b45b192 --- /dev/null +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdbLocator.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2010 The Android Open Source Project + * + * Licensed under the Eclipse Public License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.eclipse.org/org/documents/epl-v10.php + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.ide.eclipse.adt; + +import com.android.ide.eclipse.ddms.IAdbLocator; + +public class AdbLocator implements IAdbLocator { + + public String getAdbLocation() { + return AdtPlugin.getOsAbsoluteAdb(); + } +} diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java index 77ba50e..404fc56 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java @@ -43,7 +43,6 @@ import com.android.ide.eclipse.adt.internal.sdk.Sdk; import com.android.ide.eclipse.adt.internal.sdk.Sdk.ITargetChangeListener; import com.android.ide.eclipse.adt.internal.ui.EclipseUiHelper; import com.android.ide.eclipse.ddms.DdmsPlugin; -import com.android.ide.eclipse.hierarchyviewer.HierarchyViewerPlugin; import com.android.sdklib.IAndroidTarget; import com.android.sdklib.SdkConstants; import com.android.sdkstats.SdkStatsService; @@ -232,7 +231,6 @@ public class AdtPlugin extends AbstractUIPlugin { // finally restart adb, in case it's a different version DdmsPlugin.setAdb(getOsAbsoluteAdb(), true /* startAdb */); - HierarchyViewerPlugin.setAdb(getOsAbsoluteAdb(), true /* startAdb */); // get the SDK location and build id. if (checkSdkLocationAndId()) { @@ -250,13 +248,6 @@ public class AdtPlugin extends AbstractUIPlugin { // check the location of SDK final boolean isSdkLocationValid = checkSdkLocationAndId(); - // start the DdmsPlugin by setting the adb location, only if it is set already. - String osSdkLocation = AdtPrefs.getPrefs().getOsSdkFolder(); - if (osSdkLocation.length() > 0) { - DdmsPlugin.setAdb(getOsAbsoluteAdb(), true); - HierarchyViewerPlugin.setAdb(getOsAbsoluteAdb(), true); - } - // and give it the debug launcher for android projects DdmsPlugin.setRunningAppDebugLauncher(new DdmsPlugin.IDebugLauncher() { public boolean debug(String appName, int port) { |