Skip to content

Commit

Permalink
Release 1.5.4 - Compatibility with Android Studio 3.6-alpha12
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
pbreault committed Sep 20, 2019
1 parent 25c669d commit e54f6c7
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 93 deletions.
11 changes: 0 additions & 11 deletions src/main/java/com/developerphil/adbidea/ui/MyDeviceChooser.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,6 @@ public class MyDeviceChooser implements Disposable {

private final AndroidFacet myFacet;
private final Condition<IDevice> myFilter;
private final AndroidVersion myMinSdkVersion;
private final IAndroidTarget myProjectTarget;
private final EnumSet<IDevice.HardwareFeature> myRequiredHardwareFeatures;

private int[] mySelectedRows;
private boolean hadUserInteraction = false;
Expand All @@ -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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -56,18 +55,6 @@ class DeviceResultFetcher constructor(private val project: Project, private val
return facet
}

private fun getApplicationFacets(project: Project): List<AndroidFacet> {

val facets = Lists.newArrayList<AndroidFacet>()
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()
Expand All @@ -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()
}

}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<idea-plugin url="https://github.com/pbreault/adb-idea">
<id>com.developerphil.adbidea</id>
<name>ADB Idea</name>
<version>1.5.3</version>
<version>1.5.4</version>
<vendor url="http://www.developerphil.com">Philippe Breault</vendor>

<description><![CDATA[
Expand All @@ -27,6 +27,10 @@


<change-notes><![CDATA[
<b>1.5.4</b>
<ul>
<li>BUGFIX: Compatibility with Android Studio 3.6-alpha12+</li>
</ul>
<b>1.5.3</b>
<ul>
<li>BUGFIX: Show all connected devices on Android Studio 3.4+</li>
Expand Down Expand Up @@ -121,7 +125,7 @@

<!-- Android Studio 3.3+ -->
<!-- see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html -->
<idea-version since-build="182"/>
<idea-version since-build="183"/>

<depends>com.intellij.modules.platform</depends>
<depends>org.jetbrains.android</depends>
Expand Down
Loading

0 comments on commit e54f6c7

Please sign in to comment.