Skip to main content
Glama
tools-queriesSupport.patch2.91 kB
diff --git a/xplat/toolchains/android/sdk/third-party/java/aosp/src/com/android/manifmerger/ManifestModel.java b/xplat/toolchains/android/sdk/third-party/java/aosp/src/com/android/manifmerger/ManifestModel.java --- a/xplat/toolchains/android/sdk/third-party/java/aosp/src/com/android/manifmerger/ManifestModel.java +++ b/xplat/toolchains/android/sdk/third-party/java/aosp/src/com/android/manifmerger/ManifestModel.java @@ -143,6 +143,25 @@ private static final NoKeyNodeResolver DEFAULT_NO_KEY_NODE_RESOLVER = new NoKeyNodeResolver(); + private static final NodeKeyResolver PROVIDER_KEY_RESOLVER = + new NodeKeyResolver() { + @Override + public ImmutableList<String> getKeyAttributesNames() { + return ImmutableList.of(); + } + + @Override + public String getKey(Element element) { + // if the provider is a sub-element from queries, we are not expecting any key. + if (element.getParentNode() + .getNodeName() + .equals(ManifestModel.NodeTypes.QUERIES.name())) { + return null; + } + return DEFAULT_NAME_ATTRIBUTE_RESOLVER.getKey(element); + } + }; + /** * A {@link com.android.manifmerger.ManifestModel.NodeKeyResolver} capable of extracting the * element key first in an "android:name" attribute and if not value found there, in the @@ -460,15 +479,23 @@ AttributeModel.newModel(SdkConstants.ATTR_NAME)), /** - * Provider (contained in application) - * <br> - * <b>See also : </b> - * {@link <a href=http://developer.android.com/guide/topics/manifest/provider-element.html> - * Provider Xml documentation</a>} - */ - PROVIDER(MergeType.MERGE, DEFAULT_NAME_ATTRIBUTE_RESOLVER, - AttributeModel.newModel(SdkConstants.ATTR_NAME) - .setIsPackageDependent()), + * Provider (contained in application or queries) <br> + * <b>See also : </b> {@link <a + * href=http://developer.android.com/guide/topics/manifest/provider-element.html>Provider + * Xml documentation</a>} + */ + PROVIDER( + MergeType.MERGE, + PROVIDER_KEY_RESOLVER, + AttributeModel.newModel(SdkConstants.ATTR_NAME).setIsPackageDependent()), + + /** + * Queries <br> + * <b>See also : </b> {@link <a + * href=http://developer.android.com/guide/topics/manifest/queries-element.html>Queries Xml + * documentation</a>} + */ + QUERIES(MergeType.MERGE, DEFAULT_NO_KEY_NODE_RESOLVER), /** * Receiver (contained in application)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/systeminit/si'

If you have feedback or need assistance with the MCP directory API, please join our Discord server