Merge "Don't assume host is wildcard if not provided" into rvc-dev

This commit is contained in:
Patrick Baumann
2020-07-09 23:31:56 +00:00
committed by Android (Google) Code Review
2 changed files with 7 additions and 2 deletions

View File

@@ -1168,8 +1168,13 @@ public class IntentFilter implements Parcelable {
public int match(Uri data, boolean wildcardSupported) { public int match(Uri data, boolean wildcardSupported) {
String host = data.getHost(); String host = data.getHost();
if (host == null) { if (host == null) {
if (wildcardSupported && mWild) {
// special case, if no host is provided, but the Authority is wildcard, match
return MATCH_CATEGORY_HOST;
} else {
return NO_MATCH_DATA; return NO_MATCH_DATA;
} }
}
if (false) Log.v("IntentFilter", if (false) Log.v("IntentFilter",
"Match host " + host + ": " + mHost); "Match host " + host + ": " + mHost);
if (!wildcardSupported || !WILDCARD.equals(host)) { if (!wildcardSupported || !WILDCARD.equals(host)) {

View File

@@ -1510,7 +1510,7 @@ public class ParsingPackageUtils {
Uri data = null; Uri data = null;
String dataType = null; String dataType = null;
String host = IntentFilter.WILDCARD; String host = null;
final int numActions = intentInfo.countActions(); final int numActions = intentInfo.countActions();
final int numSchemes = intentInfo.countDataSchemes(); final int numSchemes = intentInfo.countDataSchemes();
final int numTypes = intentInfo.countDataTypes(); final int numTypes = intentInfo.countDataTypes();