From 0815ac13723472570173c15313a7009abf8927ac Mon Sep 17 00:00:00 2001 From: Rhed Jao Date: Mon, 10 Jan 2022 18:34:48 +0800 Subject: [PATCH] Fix queries tag for browsers matches intent filters incorrectly The queries tag in the manifest that declares intent's visibility with the uri data without the host name should only match browsers' intent filters. This CL fixes intent filters with a wildcard prefix in the host name are matched incorrectly by the queries of browsers. Bug: 210405218 Test: atest AppEnumerationTests Test: atest IntentFilterTest Change-Id: Ib4e968c1f9e6e543c1d3dece230579def10ee306 --- core/java/android/content/IntentFilter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/java/android/content/IntentFilter.java b/core/java/android/content/IntentFilter.java index 32827ae11e0b3..b3435b1180c2d 100644 --- a/core/java/android/content/IntentFilter.java +++ b/core/java/android/content/IntentFilter.java @@ -1182,7 +1182,7 @@ public class IntentFilter implements Parcelable { public int match(Uri data, boolean wildcardSupported) { String host = data.getHost(); if (host == null) { - if (wildcardSupported && mWild) { + if (wildcardSupported && mWild && mHost.isEmpty()) { // special case, if no host is provided, but the Authority is wildcard, match return MATCH_CATEGORY_HOST; } else {