Ignore port when matching with wildcards
This change ensures that we don't take port into account when matching
queries tags against intent filters as port is not a supported value in
a queries intent tag. Adding support for this in a future release will
just limit the scope of the queries tag on thos releases; it will still
be ignored in this release.
Bug: 151638510
Test: atest IntentFilterTest
Change-Id: I69d77ae6bebf3984bfe8e8a0f6c2e9e91ee69298
diff --git a/core/java/android/content/IntentFilter.java b/core/java/android/content/IntentFilter.java
index 745add1..11d3f52 100644
--- a/core/java/android/content/IntentFilter.java
+++ b/core/java/android/content/IntentFilter.java
@@ -1183,7 +1183,8 @@
return NO_MATCH_DATA;
}
}
- if (mPort >= 0) {
+ // if we're dealing with wildcard support, we ignore ports
+ if (!wildcardSupported && mPort >= 0) {
if (mPort != data.getPort()) {
return NO_MATCH_DATA;
}