Loading core/api/current.txt +5 −0 Original line number Original line Diff line number Diff line Loading @@ -1054,9 +1054,11 @@ package android { field public static final int parentActivityName = 16843687; // 0x10103a7 field public static final int parentActivityName = 16843687; // 0x10103a7 field @Deprecated public static final int password = 16843100; // 0x101015c field @Deprecated public static final int password = 16843100; // 0x101015c field public static final int path = 16842794; // 0x101002a field public static final int path = 16842794; // 0x101002a field public static final int pathAdvancedPattern = 16844318; // 0x101061e field public static final int pathData = 16843781; // 0x1010405 field public static final int pathData = 16843781; // 0x1010405 field public static final int pathPattern = 16842796; // 0x101002c field public static final int pathPattern = 16842796; // 0x101002c field public static final int pathPrefix = 16842795; // 0x101002b field public static final int pathPrefix = 16842795; // 0x101002b field public static final int pathSuffix = 16844316; // 0x101061c field public static final int patternPathData = 16843978; // 0x10104ca field public static final int patternPathData = 16843978; // 0x10104ca field public static final int permission = 16842758; // 0x1010006 field public static final int permission = 16842758; // 0x1010006 field public static final int permissionFlags = 16843719; // 0x10103c7 field public static final int permissionFlags = 16843719; // 0x10103c7 Loading Loading @@ -1290,8 +1292,10 @@ package android { field public static final int spotShadowAlpha = 16843967; // 0x10104bf field public static final int spotShadowAlpha = 16843967; // 0x10104bf field public static final int src = 16843033; // 0x1010119 field public static final int src = 16843033; // 0x1010119 field public static final int ssp = 16843747; // 0x10103e3 field public static final int ssp = 16843747; // 0x10103e3 field public static final int sspAdvancedPattern = 16844319; // 0x101061f field public static final int sspPattern = 16843749; // 0x10103e5 field public static final int sspPattern = 16843749; // 0x10103e5 field public static final int sspPrefix = 16843748; // 0x10103e4 field public static final int sspPrefix = 16843748; // 0x10103e4 field public static final int sspSuffix = 16844317; // 0x101061d field public static final int stackFromBottom = 16843005; // 0x10100fd field public static final int stackFromBottom = 16843005; // 0x10100fd field public static final int stackViewStyle = 16843838; // 0x101043e field public static final int stackViewStyle = 16843838; // 0x101043e field public static final int starStyle = 16842882; // 0x1010082 field public static final int starStyle = 16842882; // 0x1010082 Loading Loading @@ -30943,6 +30947,7 @@ package android.os { field public static final int PATTERN_LITERAL = 0; // 0x0 field public static final int PATTERN_LITERAL = 0; // 0x0 field public static final int PATTERN_PREFIX = 1; // 0x1 field public static final int PATTERN_PREFIX = 1; // 0x1 field public static final int PATTERN_SIMPLE_GLOB = 2; // 0x2 field public static final int PATTERN_SIMPLE_GLOB = 2; // 0x2 field public static final int PATTERN_SUFFIX = 4; // 0x4 } } public final class PersistableBundle extends android.os.BaseBundle implements java.lang.Cloneable android.os.Parcelable { public final class PersistableBundle extends android.os.BaseBundle implements java.lang.Cloneable android.os.Parcelable { core/java/android/content/IntentFilter.java +15 −2 Original line number Original line Diff line number Diff line Loading @@ -150,6 +150,7 @@ public class IntentFilter implements Parcelable { private static final String AGLOB_STR = "aglob"; private static final String AGLOB_STR = "aglob"; private static final String SGLOB_STR = "sglob"; private static final String SGLOB_STR = "sglob"; private static final String PREFIX_STR = "prefix"; private static final String PREFIX_STR = "prefix"; private static final String SUFFIX_STR = "suffix"; private static final String LITERAL_STR = "literal"; private static final String LITERAL_STR = "literal"; private static final String PATH_STR = "path"; private static final String PATH_STR = "path"; private static final String PORT_STR = "port"; private static final String PORT_STR = "port"; Loading Loading @@ -1226,7 +1227,8 @@ public class IntentFilter implements Parcelable { * path, or a simple pattern, depending on <var>type</var>. * path, or a simple pattern, depending on <var>type</var>. * @param type Determines how <var>ssp</var> will be compared to * @param type Determines how <var>ssp</var> will be compared to * determine a match: either {@link PatternMatcher#PATTERN_LITERAL}, * determine a match: either {@link PatternMatcher#PATTERN_LITERAL}, * {@link PatternMatcher#PATTERN_PREFIX}, or * {@link PatternMatcher#PATTERN_PREFIX}, * {@link PatternMatcher#PATTERN_SUFFIX}, or * {@link PatternMatcher#PATTERN_SIMPLE_GLOB}. * {@link PatternMatcher#PATTERN_SIMPLE_GLOB}. * * * @see #matchData * @see #matchData Loading Loading @@ -1419,7 +1421,8 @@ public class IntentFilter implements Parcelable { * path, or a simple pattern, depending on <var>type</var>. * path, or a simple pattern, depending on <var>type</var>. * @param type Determines how <var>path</var> will be compared to * @param type Determines how <var>path</var> will be compared to * determine a match: either {@link PatternMatcher#PATTERN_LITERAL}, * determine a match: either {@link PatternMatcher#PATTERN_LITERAL}, * {@link PatternMatcher#PATTERN_PREFIX}, or * {@link PatternMatcher#PATTERN_PREFIX}, * {@link PatternMatcher#PATTERN_SUFFIX}, or * {@link PatternMatcher#PATTERN_SIMPLE_GLOB}. * {@link PatternMatcher#PATTERN_SIMPLE_GLOB}. * * * @see #matchData * @see #matchData Loading Loading @@ -1920,6 +1923,9 @@ public class IntentFilter implements Parcelable { case PatternMatcher.PATTERN_ADVANCED_GLOB: case PatternMatcher.PATTERN_ADVANCED_GLOB: serializer.attribute(null, AGLOB_STR, pe.getPath()); serializer.attribute(null, AGLOB_STR, pe.getPath()); break; break; case PatternMatcher.PATTERN_SUFFIX: serializer.attribute(null, SUFFIX_STR, pe.getPath()); break; } } serializer.endTag(null, SSP_STR); serializer.endTag(null, SSP_STR); } } Loading Loading @@ -1950,6 +1956,9 @@ public class IntentFilter implements Parcelable { case PatternMatcher.PATTERN_ADVANCED_GLOB: case PatternMatcher.PATTERN_ADVANCED_GLOB: serializer.attribute(null, AGLOB_STR, pe.getPath()); serializer.attribute(null, AGLOB_STR, pe.getPath()); break; break; case PatternMatcher.PATTERN_SUFFIX: serializer.attribute(null, SUFFIX_STR, pe.getPath()); break; } } serializer.endTag(null, PATH_STR); serializer.endTag(null, PATH_STR); } } Loading Loading @@ -2057,6 +2066,8 @@ public class IntentFilter implements Parcelable { addDataSchemeSpecificPart(ssp, PatternMatcher.PATTERN_SIMPLE_GLOB); addDataSchemeSpecificPart(ssp, PatternMatcher.PATTERN_SIMPLE_GLOB); } else if ((ssp=parser.getAttributeValue(null, AGLOB_STR)) != null) { } else if ((ssp=parser.getAttributeValue(null, AGLOB_STR)) != null) { addDataSchemeSpecificPart(ssp, PatternMatcher.PATTERN_ADVANCED_GLOB); addDataSchemeSpecificPart(ssp, PatternMatcher.PATTERN_ADVANCED_GLOB); } else if ((ssp=parser.getAttributeValue(null, SUFFIX_STR)) != null) { addDataSchemeSpecificPart(ssp, PatternMatcher.PATTERN_SUFFIX); } } } else if (tagName.equals(AUTH_STR)) { } else if (tagName.equals(AUTH_STR)) { String host = parser.getAttributeValue(null, HOST_STR); String host = parser.getAttributeValue(null, HOST_STR); Loading @@ -2074,6 +2085,8 @@ public class IntentFilter implements Parcelable { addDataPath(path, PatternMatcher.PATTERN_SIMPLE_GLOB); addDataPath(path, PatternMatcher.PATTERN_SIMPLE_GLOB); } else if ((path=parser.getAttributeValue(null, AGLOB_STR)) != null) { } else if ((path=parser.getAttributeValue(null, AGLOB_STR)) != null) { addDataPath(path, PatternMatcher.PATTERN_ADVANCED_GLOB); addDataPath(path, PatternMatcher.PATTERN_ADVANCED_GLOB); } else if ((path=parser.getAttributeValue(null, SUFFIX_STR)) != null) { addDataPath(path, PatternMatcher.PATTERN_SUFFIX); } } } else { } else { Log.w("IntentFilter", "Unknown tag parsing IntentFilter: " + tagName); Log.w("IntentFilter", "Unknown tag parsing IntentFilter: " + tagName); Loading core/java/android/content/pm/parsing/component/ParsedIntentInfoUtils.java +26 −0 Original line number Original line Diff line number Diff line Loading @@ -209,6 +209,25 @@ public class ParsedIntentInfoUtils { PatternMatcher.PATTERN_SIMPLE_GLOB); PatternMatcher.PATTERN_SIMPLE_GLOB); } } str = sa.getNonConfigurationString( R.styleable.AndroidManifestData_sspAdvancedPattern, 0); if (str != null) { if (!allowGlobs) { return input.error( "sspAdvancedPattern not allowed here; ssp must be literal"); } intentInfo.addDataSchemeSpecificPart(str, PatternMatcher.PATTERN_ADVANCED_GLOB); } str = sa.getNonConfigurationString( R.styleable.AndroidManifestData_sspSuffix, 0); if (str != null) { intentInfo.addDataSchemeSpecificPart(str, PatternMatcher.PATTERN_SUFFIX); } String host = sa.getNonConfigurationString( String host = sa.getNonConfigurationString( R.styleable.AndroidManifestData_host, 0); R.styleable.AndroidManifestData_host, 0); String port = sa.getNonConfigurationString( String port = sa.getNonConfigurationString( Loading Loading @@ -249,6 +268,13 @@ public class ParsedIntentInfoUtils { intentInfo.addDataPath(str, PatternMatcher.PATTERN_ADVANCED_GLOB); intentInfo.addDataPath(str, PatternMatcher.PATTERN_ADVANCED_GLOB); } } str = sa.getNonConfigurationString( R.styleable.AndroidManifestData_pathSuffix, 0); if (str != null) { intentInfo.addDataPath(str, PatternMatcher.PATTERN_SUFFIX); } return input.success(null); return input.success(null); } finally { } finally { sa.recycle(); sa.recycle(); Loading core/java/android/content/pm/parsing/component/ParsedProviderUtils.java +29 −9 Original line number Original line Diff line number Diff line Loading @@ -211,9 +211,14 @@ public class ParsedProviderUtils { R.styleable.AndroidManifestGrantUriPermission); R.styleable.AndroidManifestGrantUriPermission); try { try { String name = parser.getName(); String name = parser.getName(); // Pattern has priority over prefix over literal path // Pattern has priority over pre/suffix over literal path PatternMatcher pa = null; PatternMatcher pa = null; String str = sa.getNonConfigurationString( String str = sa.getNonConfigurationString( R.styleable.AndroidManifestGrantUriPermission_pathAdvancedPattern, 0); if (str != null) { pa = new PatternMatcher(str, PatternMatcher.PATTERN_ADVANCED_GLOB); } else { str = sa.getNonConfigurationString( R.styleable.AndroidManifestGrantUriPermission_pathPattern, 0); R.styleable.AndroidManifestGrantUriPermission_pathPattern, 0); if (str != null) { if (str != null) { pa = new PatternMatcher(str, PatternMatcher.PATTERN_SIMPLE_GLOB); pa = new PatternMatcher(str, PatternMatcher.PATTERN_SIMPLE_GLOB); Loading @@ -222,6 +227,11 @@ public class ParsedProviderUtils { R.styleable.AndroidManifestGrantUriPermission_pathPrefix, 0); R.styleable.AndroidManifestGrantUriPermission_pathPrefix, 0); if (str != null) { if (str != null) { pa = new PatternMatcher(str, PatternMatcher.PATTERN_PREFIX); pa = new PatternMatcher(str, PatternMatcher.PATTERN_PREFIX); } else { str = sa.getNonConfigurationString( R.styleable.AndroidManifestGrantUriPermission_pathSuffix, 0); if (str != null) { pa = new PatternMatcher(str, PatternMatcher.PATTERN_SUFFIX); } else { } else { str = sa.getNonConfigurationString( str = sa.getNonConfigurationString( R.styleable.AndroidManifestGrantUriPermission_path, 0); R.styleable.AndroidManifestGrantUriPermission_path, 0); Loading @@ -230,6 +240,8 @@ public class ParsedProviderUtils { } } } } } } } } if (pa != null) { if (pa != null) { if (provider.uriPermissionPatterns == null) { if (provider.uriPermissionPatterns == null) { Loading Loading @@ -318,7 +330,14 @@ public class ParsedProviderUtils { pa = new PathPermission(path, PatternMatcher.PATTERN_PREFIX, readPermission, pa = new PathPermission(path, PatternMatcher.PATTERN_PREFIX, readPermission, writePermission); writePermission); } else { } else { path = sa.getNonConfigurationString(R.styleable.AndroidManifestPathPermission_path, 0); path = sa.getNonConfigurationString( R.styleable.AndroidManifestPathPermission_pathSuffix, 0); if (path != null) { pa = new PathPermission(path, PatternMatcher.PATTERN_SUFFIX, readPermission, writePermission); } else { path = sa.getNonConfigurationString( R.styleable.AndroidManifestPathPermission_path, 0); if (path != null) { if (path != null) { pa = new PathPermission(path, PatternMatcher.PATTERN_LITERAL, pa = new PathPermission(path, PatternMatcher.PATTERN_LITERAL, readPermission, writePermission); readPermission, writePermission); Loading @@ -326,6 +345,7 @@ public class ParsedProviderUtils { } } } } } } } if (pa != null) { if (pa != null) { if (provider.pathPermissions == null) { if (provider.pathPermissions == null) { Loading core/java/android/os/PatternMatcher.java +11 −0 Original line number Original line Diff line number Diff line Loading @@ -61,6 +61,12 @@ public class PatternMatcher implements Parcelable { */ */ public static final int PATTERN_ADVANCED_GLOB = 3; public static final int PATTERN_ADVANCED_GLOB = 3; /** * Pattern type: the given pattern must match the * end of the string it is tested against. */ public static final int PATTERN_SUFFIX = 4; // token types for advanced matching // token types for advanced matching private static final int TOKEN_TYPE_LITERAL = 0; private static final int TOKEN_TYPE_LITERAL = 0; private static final int TOKEN_TYPE_ANY = 1; private static final int TOKEN_TYPE_ANY = 1; Loading Loading @@ -128,6 +134,9 @@ public class PatternMatcher implements Parcelable { case PATTERN_ADVANCED_GLOB: case PATTERN_ADVANCED_GLOB: type = "ADVANCED: "; type = "ADVANCED: "; break; break; case PATTERN_SUFFIX: type = "SUFFIX: "; break; } } return "PatternMatcher{" + type + mPattern + "}"; return "PatternMatcher{" + type + mPattern + "}"; } } Loading Loading @@ -179,6 +188,8 @@ public class PatternMatcher implements Parcelable { return matchGlobPattern(pattern, match); return matchGlobPattern(pattern, match); } else if (type == PATTERN_ADVANCED_GLOB) { } else if (type == PATTERN_ADVANCED_GLOB) { return matchAdvancedPattern(parsedPattern, match); return matchAdvancedPattern(parsedPattern, match); } else if (type == PATTERN_SUFFIX) { return match.endsWith(pattern); } } return false; return false; } } Loading Loading
core/api/current.txt +5 −0 Original line number Original line Diff line number Diff line Loading @@ -1054,9 +1054,11 @@ package android { field public static final int parentActivityName = 16843687; // 0x10103a7 field public static final int parentActivityName = 16843687; // 0x10103a7 field @Deprecated public static final int password = 16843100; // 0x101015c field @Deprecated public static final int password = 16843100; // 0x101015c field public static final int path = 16842794; // 0x101002a field public static final int path = 16842794; // 0x101002a field public static final int pathAdvancedPattern = 16844318; // 0x101061e field public static final int pathData = 16843781; // 0x1010405 field public static final int pathData = 16843781; // 0x1010405 field public static final int pathPattern = 16842796; // 0x101002c field public static final int pathPattern = 16842796; // 0x101002c field public static final int pathPrefix = 16842795; // 0x101002b field public static final int pathPrefix = 16842795; // 0x101002b field public static final int pathSuffix = 16844316; // 0x101061c field public static final int patternPathData = 16843978; // 0x10104ca field public static final int patternPathData = 16843978; // 0x10104ca field public static final int permission = 16842758; // 0x1010006 field public static final int permission = 16842758; // 0x1010006 field public static final int permissionFlags = 16843719; // 0x10103c7 field public static final int permissionFlags = 16843719; // 0x10103c7 Loading Loading @@ -1290,8 +1292,10 @@ package android { field public static final int spotShadowAlpha = 16843967; // 0x10104bf field public static final int spotShadowAlpha = 16843967; // 0x10104bf field public static final int src = 16843033; // 0x1010119 field public static final int src = 16843033; // 0x1010119 field public static final int ssp = 16843747; // 0x10103e3 field public static final int ssp = 16843747; // 0x10103e3 field public static final int sspAdvancedPattern = 16844319; // 0x101061f field public static final int sspPattern = 16843749; // 0x10103e5 field public static final int sspPattern = 16843749; // 0x10103e5 field public static final int sspPrefix = 16843748; // 0x10103e4 field public static final int sspPrefix = 16843748; // 0x10103e4 field public static final int sspSuffix = 16844317; // 0x101061d field public static final int stackFromBottom = 16843005; // 0x10100fd field public static final int stackFromBottom = 16843005; // 0x10100fd field public static final int stackViewStyle = 16843838; // 0x101043e field public static final int stackViewStyle = 16843838; // 0x101043e field public static final int starStyle = 16842882; // 0x1010082 field public static final int starStyle = 16842882; // 0x1010082 Loading Loading @@ -30943,6 +30947,7 @@ package android.os { field public static final int PATTERN_LITERAL = 0; // 0x0 field public static final int PATTERN_LITERAL = 0; // 0x0 field public static final int PATTERN_PREFIX = 1; // 0x1 field public static final int PATTERN_PREFIX = 1; // 0x1 field public static final int PATTERN_SIMPLE_GLOB = 2; // 0x2 field public static final int PATTERN_SIMPLE_GLOB = 2; // 0x2 field public static final int PATTERN_SUFFIX = 4; // 0x4 } } public final class PersistableBundle extends android.os.BaseBundle implements java.lang.Cloneable android.os.Parcelable { public final class PersistableBundle extends android.os.BaseBundle implements java.lang.Cloneable android.os.Parcelable {
core/java/android/content/IntentFilter.java +15 −2 Original line number Original line Diff line number Diff line Loading @@ -150,6 +150,7 @@ public class IntentFilter implements Parcelable { private static final String AGLOB_STR = "aglob"; private static final String AGLOB_STR = "aglob"; private static final String SGLOB_STR = "sglob"; private static final String SGLOB_STR = "sglob"; private static final String PREFIX_STR = "prefix"; private static final String PREFIX_STR = "prefix"; private static final String SUFFIX_STR = "suffix"; private static final String LITERAL_STR = "literal"; private static final String LITERAL_STR = "literal"; private static final String PATH_STR = "path"; private static final String PATH_STR = "path"; private static final String PORT_STR = "port"; private static final String PORT_STR = "port"; Loading Loading @@ -1226,7 +1227,8 @@ public class IntentFilter implements Parcelable { * path, or a simple pattern, depending on <var>type</var>. * path, or a simple pattern, depending on <var>type</var>. * @param type Determines how <var>ssp</var> will be compared to * @param type Determines how <var>ssp</var> will be compared to * determine a match: either {@link PatternMatcher#PATTERN_LITERAL}, * determine a match: either {@link PatternMatcher#PATTERN_LITERAL}, * {@link PatternMatcher#PATTERN_PREFIX}, or * {@link PatternMatcher#PATTERN_PREFIX}, * {@link PatternMatcher#PATTERN_SUFFIX}, or * {@link PatternMatcher#PATTERN_SIMPLE_GLOB}. * {@link PatternMatcher#PATTERN_SIMPLE_GLOB}. * * * @see #matchData * @see #matchData Loading Loading @@ -1419,7 +1421,8 @@ public class IntentFilter implements Parcelable { * path, or a simple pattern, depending on <var>type</var>. * path, or a simple pattern, depending on <var>type</var>. * @param type Determines how <var>path</var> will be compared to * @param type Determines how <var>path</var> will be compared to * determine a match: either {@link PatternMatcher#PATTERN_LITERAL}, * determine a match: either {@link PatternMatcher#PATTERN_LITERAL}, * {@link PatternMatcher#PATTERN_PREFIX}, or * {@link PatternMatcher#PATTERN_PREFIX}, * {@link PatternMatcher#PATTERN_SUFFIX}, or * {@link PatternMatcher#PATTERN_SIMPLE_GLOB}. * {@link PatternMatcher#PATTERN_SIMPLE_GLOB}. * * * @see #matchData * @see #matchData Loading Loading @@ -1920,6 +1923,9 @@ public class IntentFilter implements Parcelable { case PatternMatcher.PATTERN_ADVANCED_GLOB: case PatternMatcher.PATTERN_ADVANCED_GLOB: serializer.attribute(null, AGLOB_STR, pe.getPath()); serializer.attribute(null, AGLOB_STR, pe.getPath()); break; break; case PatternMatcher.PATTERN_SUFFIX: serializer.attribute(null, SUFFIX_STR, pe.getPath()); break; } } serializer.endTag(null, SSP_STR); serializer.endTag(null, SSP_STR); } } Loading Loading @@ -1950,6 +1956,9 @@ public class IntentFilter implements Parcelable { case PatternMatcher.PATTERN_ADVANCED_GLOB: case PatternMatcher.PATTERN_ADVANCED_GLOB: serializer.attribute(null, AGLOB_STR, pe.getPath()); serializer.attribute(null, AGLOB_STR, pe.getPath()); break; break; case PatternMatcher.PATTERN_SUFFIX: serializer.attribute(null, SUFFIX_STR, pe.getPath()); break; } } serializer.endTag(null, PATH_STR); serializer.endTag(null, PATH_STR); } } Loading Loading @@ -2057,6 +2066,8 @@ public class IntentFilter implements Parcelable { addDataSchemeSpecificPart(ssp, PatternMatcher.PATTERN_SIMPLE_GLOB); addDataSchemeSpecificPart(ssp, PatternMatcher.PATTERN_SIMPLE_GLOB); } else if ((ssp=parser.getAttributeValue(null, AGLOB_STR)) != null) { } else if ((ssp=parser.getAttributeValue(null, AGLOB_STR)) != null) { addDataSchemeSpecificPart(ssp, PatternMatcher.PATTERN_ADVANCED_GLOB); addDataSchemeSpecificPart(ssp, PatternMatcher.PATTERN_ADVANCED_GLOB); } else if ((ssp=parser.getAttributeValue(null, SUFFIX_STR)) != null) { addDataSchemeSpecificPart(ssp, PatternMatcher.PATTERN_SUFFIX); } } } else if (tagName.equals(AUTH_STR)) { } else if (tagName.equals(AUTH_STR)) { String host = parser.getAttributeValue(null, HOST_STR); String host = parser.getAttributeValue(null, HOST_STR); Loading @@ -2074,6 +2085,8 @@ public class IntentFilter implements Parcelable { addDataPath(path, PatternMatcher.PATTERN_SIMPLE_GLOB); addDataPath(path, PatternMatcher.PATTERN_SIMPLE_GLOB); } else if ((path=parser.getAttributeValue(null, AGLOB_STR)) != null) { } else if ((path=parser.getAttributeValue(null, AGLOB_STR)) != null) { addDataPath(path, PatternMatcher.PATTERN_ADVANCED_GLOB); addDataPath(path, PatternMatcher.PATTERN_ADVANCED_GLOB); } else if ((path=parser.getAttributeValue(null, SUFFIX_STR)) != null) { addDataPath(path, PatternMatcher.PATTERN_SUFFIX); } } } else { } else { Log.w("IntentFilter", "Unknown tag parsing IntentFilter: " + tagName); Log.w("IntentFilter", "Unknown tag parsing IntentFilter: " + tagName); Loading
core/java/android/content/pm/parsing/component/ParsedIntentInfoUtils.java +26 −0 Original line number Original line Diff line number Diff line Loading @@ -209,6 +209,25 @@ public class ParsedIntentInfoUtils { PatternMatcher.PATTERN_SIMPLE_GLOB); PatternMatcher.PATTERN_SIMPLE_GLOB); } } str = sa.getNonConfigurationString( R.styleable.AndroidManifestData_sspAdvancedPattern, 0); if (str != null) { if (!allowGlobs) { return input.error( "sspAdvancedPattern not allowed here; ssp must be literal"); } intentInfo.addDataSchemeSpecificPart(str, PatternMatcher.PATTERN_ADVANCED_GLOB); } str = sa.getNonConfigurationString( R.styleable.AndroidManifestData_sspSuffix, 0); if (str != null) { intentInfo.addDataSchemeSpecificPart(str, PatternMatcher.PATTERN_SUFFIX); } String host = sa.getNonConfigurationString( String host = sa.getNonConfigurationString( R.styleable.AndroidManifestData_host, 0); R.styleable.AndroidManifestData_host, 0); String port = sa.getNonConfigurationString( String port = sa.getNonConfigurationString( Loading Loading @@ -249,6 +268,13 @@ public class ParsedIntentInfoUtils { intentInfo.addDataPath(str, PatternMatcher.PATTERN_ADVANCED_GLOB); intentInfo.addDataPath(str, PatternMatcher.PATTERN_ADVANCED_GLOB); } } str = sa.getNonConfigurationString( R.styleable.AndroidManifestData_pathSuffix, 0); if (str != null) { intentInfo.addDataPath(str, PatternMatcher.PATTERN_SUFFIX); } return input.success(null); return input.success(null); } finally { } finally { sa.recycle(); sa.recycle(); Loading
core/java/android/content/pm/parsing/component/ParsedProviderUtils.java +29 −9 Original line number Original line Diff line number Diff line Loading @@ -211,9 +211,14 @@ public class ParsedProviderUtils { R.styleable.AndroidManifestGrantUriPermission); R.styleable.AndroidManifestGrantUriPermission); try { try { String name = parser.getName(); String name = parser.getName(); // Pattern has priority over prefix over literal path // Pattern has priority over pre/suffix over literal path PatternMatcher pa = null; PatternMatcher pa = null; String str = sa.getNonConfigurationString( String str = sa.getNonConfigurationString( R.styleable.AndroidManifestGrantUriPermission_pathAdvancedPattern, 0); if (str != null) { pa = new PatternMatcher(str, PatternMatcher.PATTERN_ADVANCED_GLOB); } else { str = sa.getNonConfigurationString( R.styleable.AndroidManifestGrantUriPermission_pathPattern, 0); R.styleable.AndroidManifestGrantUriPermission_pathPattern, 0); if (str != null) { if (str != null) { pa = new PatternMatcher(str, PatternMatcher.PATTERN_SIMPLE_GLOB); pa = new PatternMatcher(str, PatternMatcher.PATTERN_SIMPLE_GLOB); Loading @@ -222,6 +227,11 @@ public class ParsedProviderUtils { R.styleable.AndroidManifestGrantUriPermission_pathPrefix, 0); R.styleable.AndroidManifestGrantUriPermission_pathPrefix, 0); if (str != null) { if (str != null) { pa = new PatternMatcher(str, PatternMatcher.PATTERN_PREFIX); pa = new PatternMatcher(str, PatternMatcher.PATTERN_PREFIX); } else { str = sa.getNonConfigurationString( R.styleable.AndroidManifestGrantUriPermission_pathSuffix, 0); if (str != null) { pa = new PatternMatcher(str, PatternMatcher.PATTERN_SUFFIX); } else { } else { str = sa.getNonConfigurationString( str = sa.getNonConfigurationString( R.styleable.AndroidManifestGrantUriPermission_path, 0); R.styleable.AndroidManifestGrantUriPermission_path, 0); Loading @@ -230,6 +240,8 @@ public class ParsedProviderUtils { } } } } } } } } if (pa != null) { if (pa != null) { if (provider.uriPermissionPatterns == null) { if (provider.uriPermissionPatterns == null) { Loading Loading @@ -318,7 +330,14 @@ public class ParsedProviderUtils { pa = new PathPermission(path, PatternMatcher.PATTERN_PREFIX, readPermission, pa = new PathPermission(path, PatternMatcher.PATTERN_PREFIX, readPermission, writePermission); writePermission); } else { } else { path = sa.getNonConfigurationString(R.styleable.AndroidManifestPathPermission_path, 0); path = sa.getNonConfigurationString( R.styleable.AndroidManifestPathPermission_pathSuffix, 0); if (path != null) { pa = new PathPermission(path, PatternMatcher.PATTERN_SUFFIX, readPermission, writePermission); } else { path = sa.getNonConfigurationString( R.styleable.AndroidManifestPathPermission_path, 0); if (path != null) { if (path != null) { pa = new PathPermission(path, PatternMatcher.PATTERN_LITERAL, pa = new PathPermission(path, PatternMatcher.PATTERN_LITERAL, readPermission, writePermission); readPermission, writePermission); Loading @@ -326,6 +345,7 @@ public class ParsedProviderUtils { } } } } } } } if (pa != null) { if (pa != null) { if (provider.pathPermissions == null) { if (provider.pathPermissions == null) { Loading
core/java/android/os/PatternMatcher.java +11 −0 Original line number Original line Diff line number Diff line Loading @@ -61,6 +61,12 @@ public class PatternMatcher implements Parcelable { */ */ public static final int PATTERN_ADVANCED_GLOB = 3; public static final int PATTERN_ADVANCED_GLOB = 3; /** * Pattern type: the given pattern must match the * end of the string it is tested against. */ public static final int PATTERN_SUFFIX = 4; // token types for advanced matching // token types for advanced matching private static final int TOKEN_TYPE_LITERAL = 0; private static final int TOKEN_TYPE_LITERAL = 0; private static final int TOKEN_TYPE_ANY = 1; private static final int TOKEN_TYPE_ANY = 1; Loading Loading @@ -128,6 +134,9 @@ public class PatternMatcher implements Parcelable { case PATTERN_ADVANCED_GLOB: case PATTERN_ADVANCED_GLOB: type = "ADVANCED: "; type = "ADVANCED: "; break; break; case PATTERN_SUFFIX: type = "SUFFIX: "; break; } } return "PatternMatcher{" + type + mPattern + "}"; return "PatternMatcher{" + type + mPattern + "}"; } } Loading Loading @@ -179,6 +188,8 @@ public class PatternMatcher implements Parcelable { return matchGlobPattern(pattern, match); return matchGlobPattern(pattern, match); } else if (type == PATTERN_ADVANCED_GLOB) { } else if (type == PATTERN_ADVANCED_GLOB) { return matchAdvancedPattern(parsedPattern, match); return matchAdvancedPattern(parsedPattern, match); } else if (type == PATTERN_SUFFIX) { return match.endsWith(pattern); } } return false; return false; } } Loading