From e54f6c72185187f1fbe4524d9a6b6246a9d3344e Mon Sep 17 00:00:00 2001 From: Philippe Breault Date: Fri, 20 Sep 2019 07:30:57 -0400 Subject: [PATCH 01/14] Release 1.5.4 - Compatibility with Android Studio 3.6-alpha12 Addresses the following issues: - Plugin Broken with AS 3.6 Canary 12 (#113) - Not working on Android Studio 3.6 Canary 1 with multiple devices connected (#110) --- .../adbidea/ui/MyDeviceChooser.java | 11 -- .../adbidea/adb/DeviceResultFetcher.kt | 26 +--- .../adbidea/debugger/Debugger.kt | 1 - src/main/resources/META-INF/plugin.xml | 8 +- .../developerphil/adbidea/adb/FakeDevice.kt | 128 ++++++++++-------- 5 files changed, 81 insertions(+), 93 deletions(-) diff --git a/src/main/java/com/developerphil/adbidea/ui/MyDeviceChooser.java b/src/main/java/com/developerphil/adbidea/ui/MyDeviceChooser.java index e86cb2e..5835971 100755 --- a/src/main/java/com/developerphil/adbidea/ui/MyDeviceChooser.java +++ b/src/main/java/com/developerphil/adbidea/ui/MyDeviceChooser.java @@ -95,9 +95,6 @@ public class MyDeviceChooser implements Disposable { private final AndroidFacet myFacet; private final Condition myFilter; - private final AndroidVersion myMinSdkVersion; - private final IAndroidTarget myProjectTarget; - private final EnumSet myRequiredHardwareFeatures; private int[] mySelectedRows; private boolean hadUserInteraction = false; @@ -112,14 +109,6 @@ public MyDeviceChooser(boolean multipleSelection, myFacet = facet; myFilter = filter; - myMinSdkVersion = AndroidModuleInfo.getInstance(facet).getRuntimeMinSdkVersion(); - myProjectTarget = projectTarget; - if (new IsWatchFeatureRequiredCompat(facet).get()) { - myRequiredHardwareFeatures = EnumSet.of(IDevice.HardwareFeature.WATCH); - } else { - myRequiredHardwareFeatures = EnumSet.noneOf(IDevice.HardwareFeature.class); - } - myDeviceTable = new JBTable(); myPanel = ScrollPaneFactory.createScrollPane(myDeviceTable); myPanel.setPreferredSize(new Dimension(450, 220)); diff --git a/src/main/kotlin/com/developerphil/adbidea/adb/DeviceResultFetcher.kt b/src/main/kotlin/com/developerphil/adbidea/adb/DeviceResultFetcher.kt index def1115..8ac5eab 100644 --- a/src/main/kotlin/com/developerphil/adbidea/adb/DeviceResultFetcher.kt +++ b/src/main/kotlin/com/developerphil/adbidea/adb/DeviceResultFetcher.kt @@ -5,7 +5,6 @@ import com.android.tools.idea.gradle.project.model.AndroidModuleModel import com.developerphil.adbidea.ui.DeviceChooserDialog import com.developerphil.adbidea.ui.ModuleChooserDialogHelper import com.developerphil.adbidea.ui.NotificationHelper -import com.google.common.collect.Lists import com.intellij.openapi.project.Project import com.intellij.openapi.ui.DialogWrapper import org.jetbrains.android.facet.AndroidFacet @@ -15,8 +14,8 @@ import org.jetbrains.android.util.AndroidUtils class DeviceResultFetcher constructor(private val project: Project, private val useSameDevicesHelper: UseSameDevicesHelper, private val bridge: Bridge) { fun fetch(): DeviceResult? { - val facets = getApplicationFacets(project) - if (!facets.isEmpty()) { + val facets = AndroidUtils.getApplicationFacets(project) + if (facets.isNotEmpty()) { val facet = getFacet(facets) ?: return null val packageName = AndroidModuleModel.get(facet)?.applicationId ?: return null @@ -56,18 +55,6 @@ class DeviceResultFetcher constructor(private val project: Project, private val return facet } - private fun getApplicationFacets(project: Project): List { - - val facets = Lists.newArrayList() - for (facet in AndroidUtils.getApplicationFacets(project)) { - if (!isTestProject(facet)) { - facets.add(facet) - } - } - - return facets - } - private fun showDeviceChooserDialog(facet: AndroidFacet, packageName: String): DeviceResult? { val chooser = DeviceChooserDialog(facet) chooser.show() @@ -83,19 +70,12 @@ class DeviceResultFetcher constructor(private val project: Project, private val useSameDevicesHelper.rememberDevices() } - if (selectedDevices.size == 0) { + if (selectedDevices.isEmpty()) { return null } return DeviceResult(selectedDevices.asList(), facet, packageName) } - - private fun isTestProject(facet: AndroidFacet): Boolean { - return facet.manifest != null - && facet.manifest!!.instrumentations != null - && !facet.manifest!!.instrumentations.isEmpty() - } - } diff --git a/src/main/kotlin/com/developerphil/adbidea/debugger/Debugger.kt b/src/main/kotlin/com/developerphil/adbidea/debugger/Debugger.kt index 0f8549a..b034af9 100644 --- a/src/main/kotlin/com/developerphil/adbidea/debugger/Debugger.kt +++ b/src/main/kotlin/com/developerphil/adbidea/debugger/Debugger.kt @@ -38,7 +38,6 @@ class Debugger(private val project: Project, private val device: IDevice, privat if (handler is AndroidProcessHandler) { val client = handler.getClient(selectedClient.device) if (client != null && client.clientData.pid == pid) { - handler.setNoKill() handler.detachProcess() handler.notifyTextAvailable("Disconnecting run session: a new debug session will be established.\n", ProcessOutputTypes.STDOUT) break diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 59572bf..5158336 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -1,7 +1,7 @@ com.developerphil.adbidea ADB Idea - 1.5.3 + 1.5.4 Philippe Breault 1.5.4 +
    +
  • BUGFIX: Compatibility with Android Studio 3.6-alpha12+
  • +
1.5.3 + 1.6.3
  • update to origin : BUGFIX: Show all connected devices on Android Studio 3.4+
@@ -147,93 +152,132 @@
  • Now support projects with more than one application module
  • ]]> - + - - - + + + - com.intellij.modules.platform - org.jetbrains.android + com.intellij.modules.platform + org.jetbrains.android - - - - - - - - + + + + + + + + + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - com.developerphil.adbidea.ObjectGraph - - + + + com.developerphil.adbidea.ObjectGraph + +
    \ No newline at end of file