mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-73890 android manifest dom: support intents completion for receiver and provider elements
This commit is contained in:
@@ -81,7 +81,7 @@ public class AndroidManifestUtils {
|
||||
else if (element instanceof Application) {
|
||||
Collections.addAll(strings, "activity", "service", "provider", "receiver", "uses-library");
|
||||
}
|
||||
else if (element instanceof Activity || element instanceof ActivityAlias) {
|
||||
else if (element instanceof Activity || element instanceof ActivityAlias || element instanceof Receiver || element instanceof Service) {
|
||||
strings.add("intent-filter");
|
||||
}
|
||||
else if (element instanceof IntentFilter) {
|
||||
|
||||
@@ -21,6 +21,8 @@ import org.jetbrains.android.dom.AndroidAttributeValue;
|
||||
import org.jetbrains.android.dom.converters.PackageClassConverter;
|
||||
import org.jetbrains.android.util.AndroidUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
@@ -31,4 +33,8 @@ public interface Receiver extends ApplicationComponent {
|
||||
@Convert(PackageClassConverter.class)
|
||||
@ExtendClass(AndroidUtils.RECEIVER_CLASS_NAME)
|
||||
AndroidAttributeValue<PsiClass> getReceiverClass();
|
||||
|
||||
List<IntentFilter> getIntentFilters();
|
||||
|
||||
IntentFilter addIntentFilter();
|
||||
}
|
||||
@@ -21,6 +21,8 @@ import org.jetbrains.android.dom.AndroidAttributeValue;
|
||||
import org.jetbrains.android.dom.converters.PackageClassConverter;
|
||||
import org.jetbrains.android.util.AndroidUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
@@ -31,4 +33,8 @@ public interface Service extends ApplicationComponent {
|
||||
@Convert(PackageClassConverter.class)
|
||||
@ExtendClass(AndroidUtils.SERVICE_CLASS_NAME)
|
||||
AndroidAttributeValue<PsiClass> getServiceClass();
|
||||
|
||||
List<IntentFilter> getIntentFilters();
|
||||
|
||||
IntentFilter addIntentFilter();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="p1.p2">
|
||||
<application android:label="@string/app_name">
|
||||
<receiver android:enabled="true" android:name=".Starter">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPL<caret>" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="p1.p2">
|
||||
<application android:label="@string/app_name">
|
||||
<receiver android:enabled="true" android:name=".Starter">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="p1.p2">
|
||||
<application android:label="@string/app_name">
|
||||
<service>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPL<caret>" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="p1.p2">
|
||||
<application android:label="@string/app_name">
|
||||
<service>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -154,4 +154,12 @@ public class AndroidManifestDomTest extends AndroidDomTest {
|
||||
copyFileToProject("MyActivity.java", "src/p1/p2/MyActivity.java");
|
||||
doTestCompletion(false);
|
||||
}
|
||||
|
||||
public void testIntentsCompletion1() throws Throwable {
|
||||
doTestCompletion();
|
||||
}
|
||||
|
||||
public void testIntentsCompletion2() throws Throwable {
|
||||
doTestCompletion();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user