From 97980133d5a46b98d336a8ce96d170c50d2e7427 Mon Sep 17 00:00:00 2001 From: Patrick Baumann Date: Thu, 14 May 2020 14:16:39 -0700 Subject: [PATCH] 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 --- core/java/android/content/IntentFilter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/java/android/content/IntentFilter.java b/core/java/android/content/IntentFilter.java index 745add1745827..11d3f529b0faa 100644 --- a/core/java/android/content/IntentFilter.java +++ b/core/java/android/content/IntentFilter.java @@ -1183,7 +1183,8 @@ public class IntentFilter implements Parcelable { 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; }