diff options
Diffstat (limited to 'eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android')
3 files changed, 31 insertions, 16 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 84274544c..7d2c36ba4 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 @@ -261,16 +261,20 @@ public final class DdmsPlugin extends AbstractUIPlugin implements IDeviceChangeL IAdbLocator[] locators = instantiateAdbLocators(elements); for (IAdbLocator locator : locators) { - String adbLocation = locator.getAdbLocation(); - if (adbLocation != null) { - // checks if the location is valid. - if (setAdbLocation(adbLocation)) { - AndroidDebugBridge.createBridge(sAdbLocation, - true /* forceNewBridge */); - - // no need to look at the other locators. - break; + try { + String adbLocation = locator.getAdbLocation(); + if (adbLocation != null) { + // checks if the location is valid. + if (setAdbLocation(adbLocation)) { + AndroidDebugBridge.createBridge(sAdbLocation, + true /* forceNewBridge */); + + // no need to look at the other locators. + break; + } } + } catch (Throwable t) { + // ignore, we'll just not use this implementation. } } @@ -711,8 +715,12 @@ public final class DdmsPlugin extends AbstractUIPlugin implements IDeviceChangeL // loop on all source revealer till one succeeds if (mSourceRevealers != null) { for (ISourceRevealer revealer : mSourceRevealers) { - if (revealer.reveal(applicationName, className, line)) { - break; + try { + if (revealer.reveal(applicationName, className, line)) { + break; + } + } catch (Throwable t) { + // ignore, we'll just not use this implementation. } } } diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/IDebuggerConnector.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/IDebuggerConnector.java index c50ba307a..b271dd89e 100644 --- a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/IDebuggerConnector.java +++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/IDebuggerConnector.java @@ -29,9 +29,10 @@ public interface IDebuggerConnector { * "selected" port can also be used if needed. * @param appName the name of the application. Usually the application's package but this * can be different if the component was setup to run in it's own process. - * @param port the preferred connection port. + * @param appPort the preferred connection port. + * @param selectedPort the port value for the selected application * @return true if success. */ - boolean connectDebugger(String appName, int port); + boolean connectDebugger(String appName, int appPort, int selectedPort); } diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/DeviceView.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/DeviceView.java index 6ddb62dff..0fa33d293 100644 --- a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/DeviceView.java +++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/DeviceView.java @@ -20,6 +20,7 @@ package com.android.ide.eclipse.ddms.views; import com.android.ddmlib.AndroidDebugBridge; import com.android.ddmlib.Client; import com.android.ddmlib.ClientData; +import com.android.ddmlib.DdmPreferences; import com.android.ddmlib.IDevice; import com.android.ddmlib.SyncException; import com.android.ddmlib.SyncService; @@ -421,9 +422,14 @@ public class DeviceView extends ViewPart implements IUiSelectionListener, IClien if (connectors != null) { for (IDebuggerConnector connector : connectors) { - if (connector.connectDebugger(packageName, - currentClient.getDebuggerListenPort())) { - return; + try { + if (connector.connectDebugger(packageName, + currentClient.getDebuggerListenPort(), + DdmPreferences.getSelectedDebugPort())) { + return; + } + } catch (Throwable t) { + // ignore, we'll just not use this implementation } } } |