aboutsummaryrefslogtreecommitdiff
path: root/eclipse/plugins/com.android.ide.eclipse.ddms/src/com
diff options
context:
space:
mode:
authorSiva Velusamy <vsiva@google.com>2011-12-19 15:20:32 -0800
committerSiva Velusamy <vsiva@google.com>2011-12-19 15:20:32 -0800
commit939fcf8c656eadcfe325bb877f824b5c74068167 (patch)
tree2540d0cdb34347b27fb14b592667f8ce3bf5f8c0 /eclipse/plugins/com.android.ide.eclipse.ddms/src/com
parent97322e8733f3c89e011415f66794aac3370512e0 (diff)
downloadsdk-939fcf8c656eadcfe325bb877f824b5c74068167.tar.gz
Do not initialize DDMS Console from ADT plugin.
When ADT plugin starts up, it attempts to set the console to be used for certain parts of DDMS to be the Android console. Doing this however causes the DDMS plugin to be activated, which launches adb server if it is not already there. Removing this enables us to not touch adb unnecessarily. This patch moves the initialization of the DDMS console into the DDMS plugin, and uses the DDMS console as opposed to the Android console for messages from DDMS. Change-Id: I010a7028a2f22ac4da1c55903e001dcdd329d91f
Diffstat (limited to 'eclipse/plugins/com.android.ide.eclipse.ddms/src/com')
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/DdmsPlugin.java31
1 files changed, 30 insertions, 1 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/DdmsPlugin.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/DdmsPlugin.java
index 6ed677bef..93c41423f 100644
--- a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/DdmsPlugin.java
+++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/DdmsPlugin.java
@@ -27,6 +27,8 @@ import com.android.ddmlib.Log.LogLevel;
import com.android.ddmuilib.DdmUiPreferences;
import com.android.ddmuilib.StackTracePanel;
import com.android.ddmuilib.DevicePanel.IUiSelectionListener;
+import com.android.ddmuilib.console.DdmConsole;
+import com.android.ddmuilib.console.IDdmConsole;
import com.android.ide.eclipse.ddms.i18n.Messages;
import com.android.ide.eclipse.ddms.preferences.PreferenceInitializer;
@@ -169,7 +171,7 @@ public final class DdmsPlugin extends AbstractUIPlugin implements IDeviceChangeL
public void printLog(LogLevel logLevel, String tag, String message) {
if (logLevel.getPriority() >= LogLevel.ERROR.getPriority()) {
printToStream(errorConsoleStream, tag, message);
- ConsolePlugin.getDefault().getConsoleManager().showConsoleView(mDdmsConsole);
+ showConsoleView(mDdmsConsole);
} else {
printToStream(consoleStream, tag, message);
}
@@ -193,6 +195,28 @@ public final class DdmsPlugin extends AbstractUIPlugin implements IDeviceChangeL
});
+ // set up the ddms console to use this objects
+ DdmConsole.setConsole(new IDdmConsole() {
+ public void printErrorToConsole(String message) {
+ printToStream(errorConsoleStream, null, message);
+ showConsoleView(mDdmsConsole);
+ }
+ public void printErrorToConsole(String[] messages) {
+ for (String m : messages) {
+ printToStream(errorConsoleStream, null, m);
+ }
+ showConsoleView(mDdmsConsole);
+ }
+ public void printToConsole(String message) {
+ printToStream(consoleStream, null, message);
+ }
+ public void printToConsole(String[] messages) {
+ for (String m : messages) {
+ printToStream(consoleStream, null, m);
+ }
+ }
+ });
+
// set the listener for the preference change
eclipseStore.addPropertyChangeListener(new IPropertyChangeListener() {
public void propertyChange(PropertyChangeEvent event) {
@@ -309,6 +333,11 @@ public final class DdmsPlugin extends AbstractUIPlugin implements IDeviceChangeL
}.schedule();
}
+ private void showConsoleView(MessageConsole console) {
+ ConsolePlugin.getDefault().getConsoleManager().showConsoleView(console);
+ }
+
+
private IConfigurationElement[] findConfigElements(String name) {
// get the adb location from an implementation of the ADB Locator extension point.