Loading core/java/android/content/pm/PackageParser.java +44 −9 Original line number Diff line number Diff line Loading @@ -3789,6 +3789,8 @@ public class PackageParser { ApplicationInfo.PRIVATE_FLAG_PARTIALLY_DIRECT_BOOT_AWARE; } final boolean hasVisibleToEphemeral = sa.hasValue(R.styleable.AndroidManifestActivity_visibleToEphemeral); final boolean isEphemeral = ((flags & PARSE_IS_EPHEMERAL) != 0); final boolean visibleToEphemeral = isEphemeral || sa.getBoolean(R.styleable.AndroidManifestActivity_visibleToEphemeral, false); Loading Loading @@ -3827,7 +3829,7 @@ public class PackageParser { return null; } intent.setEphemeral(isEphemeral); intent.setVisibleToEphemeral(visibleToEphemeral); intent.setVisibleToEphemeral(visibleToEphemeral || isWebBrowsableIntent(intent)); if (intent.countActions() == 0) { Slog.w(TAG, "No actions in intent filter at " + mArchiveSourcePath + " " Loading @@ -3835,6 +3837,10 @@ public class PackageParser { } else { a.intents.add(intent); } // adjust activity flags when we implicitly expose it via a browsable filter if (!hasVisibleToEphemeral && intent.isVisibleToEphemeral()) { a.info.flags |= ActivityInfo.FLAG_VISIBLE_TO_EPHEMERAL; } } else if (!receiver && parser.getName().equals("preferred")) { ActivityIntentInfo intent = new ActivityIntentInfo(a); if (!parseIntent(res, parser, false /*allowGlobs*/, false /*allowAutoVerify*/, Loading @@ -3842,7 +3848,7 @@ public class PackageParser { return null; } intent.setEphemeral(isEphemeral); intent.setVisibleToEphemeral(visibleToEphemeral); intent.setVisibleToEphemeral(visibleToEphemeral || isWebBrowsableIntent(intent)); if (intent.countActions() == 0) { Slog.w(TAG, "No actions in preferred at " + mArchiveSourcePath + " " Loading @@ -3853,6 +3859,10 @@ public class PackageParser { } owner.preferredActivityFilters.add(intent); } // adjust activity flags when we implicitly expose it via a browsable filter if (!hasVisibleToEphemeral && intent.isVisibleToEphemeral()) { a.info.flags |= ActivityInfo.FLAG_VISIBLE_TO_EPHEMERAL; } } else if (parser.getName().equals("meta-data")) { if ((a.metaData = parseMetaData(res, parser, a.metaData, outError)) == null) { Loading Loading @@ -4093,6 +4103,7 @@ public class PackageParser { } } // TODO add visibleToInstantApp attribute to activity alias final boolean isEphemeral = ((flags & PARSE_IS_EPHEMERAL) != 0); final boolean visibleToEphemeral = isEphemeral || ((a.info.flags & ActivityInfo.FLAG_VISIBLE_TO_EPHEMERAL) != 0); Loading Loading @@ -4124,9 +4135,14 @@ public class PackageParser { + parser.getPositionDescription()); } else { intent.setEphemeral(isEphemeral); intent.setVisibleToEphemeral(visibleToEphemeral); intent.setVisibleToEphemeral(visibleToEphemeral || isWebBrowsableIntent(intent)); a.intents.add(intent); } // adjust activity flags when we implicitly expose it via a browsable filter if (intent.isVisibleToEphemeral()) { a.info.flags |= ActivityInfo.FLAG_VISIBLE_TO_EPHEMERAL; } } else if (parser.getName().equals("meta-data")) { if ((a.metaData=parseMetaData(res, parser, a.metaData, outError)) == null) { Loading Loading @@ -4262,6 +4278,8 @@ public class PackageParser { ApplicationInfo.PRIVATE_FLAG_PARTIALLY_DIRECT_BOOT_AWARE; } final boolean hasVisibleToEphemeral = sa.hasValue(R.styleable.AndroidManifestProvider_visibleToEphemeral); final boolean isEphemeral = ((flags & PARSE_IS_EPHEMERAL) != 0); final boolean visibleToEphemeral = isEphemeral || sa.getBoolean(R.styleable.AndroidManifestProvider_visibleToEphemeral, false); Loading Loading @@ -4291,7 +4309,8 @@ public class PackageParser { } p.info.authority = cpname.intern(); if (!parseProviderTags(res, parser, isEphemeral, visibleToEphemeral, p, outError)) { if (!parseProviderTags( res, parser, isEphemeral, hasVisibleToEphemeral, visibleToEphemeral, p, outError)) { return null; } Loading @@ -4299,7 +4318,8 @@ public class PackageParser { } private boolean parseProviderTags(Resources res, XmlResourceParser parser, boolean isEphemeral, boolean visibleToEphemeral, Provider outInfo, String[] outError) boolean isEphemeral, boolean hasVisibleToEphemeral, boolean visibleToEphemeral, Provider outInfo, String[] outError) throws XmlPullParserException, IOException { int outerDepth = parser.getDepth(); int type; Loading @@ -4317,8 +4337,12 @@ public class PackageParser { return false; } intent.setEphemeral(isEphemeral); intent.setVisibleToEphemeral(visibleToEphemeral); intent.setVisibleToEphemeral(visibleToEphemeral || isWebBrowsableIntent(intent)); outInfo.intents.add(intent); // adjust provider flags when we implicitly expose it via a browsable filter if (!hasVisibleToEphemeral && intent.isVisibleToEphemeral()) { outInfo.info.flags |= ProviderInfo.FLAG_VISIBLE_TO_EPHEMERAL; } } else if (parser.getName().equals("meta-data")) { if ((outInfo.metaData=parseMetaData(res, parser, Loading Loading @@ -4565,6 +4589,8 @@ public class PackageParser { ApplicationInfo.PRIVATE_FLAG_PARTIALLY_DIRECT_BOOT_AWARE; } final boolean hasVisibleToEphemeral = sa.hasValue(R.styleable.AndroidManifestService_visibleToEphemeral); final boolean isEphemeral = ((flags & PARSE_IS_EPHEMERAL) != 0); final boolean visibleToEphemeral = isEphemeral || sa.getBoolean(R.styleable.AndroidManifestService_visibleToEphemeral, false); Loading Loading @@ -4600,8 +4626,11 @@ public class PackageParser { return null; } intent.setEphemeral(isEphemeral); intent.setVisibleToEphemeral(visibleToEphemeral); intent.setVisibleToEphemeral(visibleToEphemeral || isWebBrowsableIntent(intent)); // adjust activity flags when we implicitly expose it via a browsable filter if (!hasVisibleToEphemeral && intent.isVisibleToEphemeral()) { s.info.flags |= ServiceInfo.FLAG_VISIBLE_TO_EPHEMERAL; } s.intents.add(intent); } else if (parser.getName().equals("meta-data")) { if ((s.metaData=parseMetaData(res, parser, s.metaData, Loading Loading @@ -4629,6 +4658,12 @@ public class PackageParser { return s; } private boolean isWebBrowsableIntent(IntentInfo intent) { return intent.hasAction(Intent.ACTION_VIEW) && intent.hasCategory(Intent.CATEGORY_BROWSABLE) && (intent.hasDataScheme("http") || intent.hasDataScheme("https")); } private boolean parseAllMetaData(Resources res, XmlResourceParser parser, String tag, Component<?> outInfo, String[] outError) throws XmlPullParserException, IOException { int outerDepth = parser.getDepth(); Loading Loading
core/java/android/content/pm/PackageParser.java +44 −9 Original line number Diff line number Diff line Loading @@ -3789,6 +3789,8 @@ public class PackageParser { ApplicationInfo.PRIVATE_FLAG_PARTIALLY_DIRECT_BOOT_AWARE; } final boolean hasVisibleToEphemeral = sa.hasValue(R.styleable.AndroidManifestActivity_visibleToEphemeral); final boolean isEphemeral = ((flags & PARSE_IS_EPHEMERAL) != 0); final boolean visibleToEphemeral = isEphemeral || sa.getBoolean(R.styleable.AndroidManifestActivity_visibleToEphemeral, false); Loading Loading @@ -3827,7 +3829,7 @@ public class PackageParser { return null; } intent.setEphemeral(isEphemeral); intent.setVisibleToEphemeral(visibleToEphemeral); intent.setVisibleToEphemeral(visibleToEphemeral || isWebBrowsableIntent(intent)); if (intent.countActions() == 0) { Slog.w(TAG, "No actions in intent filter at " + mArchiveSourcePath + " " Loading @@ -3835,6 +3837,10 @@ public class PackageParser { } else { a.intents.add(intent); } // adjust activity flags when we implicitly expose it via a browsable filter if (!hasVisibleToEphemeral && intent.isVisibleToEphemeral()) { a.info.flags |= ActivityInfo.FLAG_VISIBLE_TO_EPHEMERAL; } } else if (!receiver && parser.getName().equals("preferred")) { ActivityIntentInfo intent = new ActivityIntentInfo(a); if (!parseIntent(res, parser, false /*allowGlobs*/, false /*allowAutoVerify*/, Loading @@ -3842,7 +3848,7 @@ public class PackageParser { return null; } intent.setEphemeral(isEphemeral); intent.setVisibleToEphemeral(visibleToEphemeral); intent.setVisibleToEphemeral(visibleToEphemeral || isWebBrowsableIntent(intent)); if (intent.countActions() == 0) { Slog.w(TAG, "No actions in preferred at " + mArchiveSourcePath + " " Loading @@ -3853,6 +3859,10 @@ public class PackageParser { } owner.preferredActivityFilters.add(intent); } // adjust activity flags when we implicitly expose it via a browsable filter if (!hasVisibleToEphemeral && intent.isVisibleToEphemeral()) { a.info.flags |= ActivityInfo.FLAG_VISIBLE_TO_EPHEMERAL; } } else if (parser.getName().equals("meta-data")) { if ((a.metaData = parseMetaData(res, parser, a.metaData, outError)) == null) { Loading Loading @@ -4093,6 +4103,7 @@ public class PackageParser { } } // TODO add visibleToInstantApp attribute to activity alias final boolean isEphemeral = ((flags & PARSE_IS_EPHEMERAL) != 0); final boolean visibleToEphemeral = isEphemeral || ((a.info.flags & ActivityInfo.FLAG_VISIBLE_TO_EPHEMERAL) != 0); Loading Loading @@ -4124,9 +4135,14 @@ public class PackageParser { + parser.getPositionDescription()); } else { intent.setEphemeral(isEphemeral); intent.setVisibleToEphemeral(visibleToEphemeral); intent.setVisibleToEphemeral(visibleToEphemeral || isWebBrowsableIntent(intent)); a.intents.add(intent); } // adjust activity flags when we implicitly expose it via a browsable filter if (intent.isVisibleToEphemeral()) { a.info.flags |= ActivityInfo.FLAG_VISIBLE_TO_EPHEMERAL; } } else if (parser.getName().equals("meta-data")) { if ((a.metaData=parseMetaData(res, parser, a.metaData, outError)) == null) { Loading Loading @@ -4262,6 +4278,8 @@ public class PackageParser { ApplicationInfo.PRIVATE_FLAG_PARTIALLY_DIRECT_BOOT_AWARE; } final boolean hasVisibleToEphemeral = sa.hasValue(R.styleable.AndroidManifestProvider_visibleToEphemeral); final boolean isEphemeral = ((flags & PARSE_IS_EPHEMERAL) != 0); final boolean visibleToEphemeral = isEphemeral || sa.getBoolean(R.styleable.AndroidManifestProvider_visibleToEphemeral, false); Loading Loading @@ -4291,7 +4309,8 @@ public class PackageParser { } p.info.authority = cpname.intern(); if (!parseProviderTags(res, parser, isEphemeral, visibleToEphemeral, p, outError)) { if (!parseProviderTags( res, parser, isEphemeral, hasVisibleToEphemeral, visibleToEphemeral, p, outError)) { return null; } Loading @@ -4299,7 +4318,8 @@ public class PackageParser { } private boolean parseProviderTags(Resources res, XmlResourceParser parser, boolean isEphemeral, boolean visibleToEphemeral, Provider outInfo, String[] outError) boolean isEphemeral, boolean hasVisibleToEphemeral, boolean visibleToEphemeral, Provider outInfo, String[] outError) throws XmlPullParserException, IOException { int outerDepth = parser.getDepth(); int type; Loading @@ -4317,8 +4337,12 @@ public class PackageParser { return false; } intent.setEphemeral(isEphemeral); intent.setVisibleToEphemeral(visibleToEphemeral); intent.setVisibleToEphemeral(visibleToEphemeral || isWebBrowsableIntent(intent)); outInfo.intents.add(intent); // adjust provider flags when we implicitly expose it via a browsable filter if (!hasVisibleToEphemeral && intent.isVisibleToEphemeral()) { outInfo.info.flags |= ProviderInfo.FLAG_VISIBLE_TO_EPHEMERAL; } } else if (parser.getName().equals("meta-data")) { if ((outInfo.metaData=parseMetaData(res, parser, Loading Loading @@ -4565,6 +4589,8 @@ public class PackageParser { ApplicationInfo.PRIVATE_FLAG_PARTIALLY_DIRECT_BOOT_AWARE; } final boolean hasVisibleToEphemeral = sa.hasValue(R.styleable.AndroidManifestService_visibleToEphemeral); final boolean isEphemeral = ((flags & PARSE_IS_EPHEMERAL) != 0); final boolean visibleToEphemeral = isEphemeral || sa.getBoolean(R.styleable.AndroidManifestService_visibleToEphemeral, false); Loading Loading @@ -4600,8 +4626,11 @@ public class PackageParser { return null; } intent.setEphemeral(isEphemeral); intent.setVisibleToEphemeral(visibleToEphemeral); intent.setVisibleToEphemeral(visibleToEphemeral || isWebBrowsableIntent(intent)); // adjust activity flags when we implicitly expose it via a browsable filter if (!hasVisibleToEphemeral && intent.isVisibleToEphemeral()) { s.info.flags |= ServiceInfo.FLAG_VISIBLE_TO_EPHEMERAL; } s.intents.add(intent); } else if (parser.getName().equals("meta-data")) { if ((s.metaData=parseMetaData(res, parser, s.metaData, Loading Loading @@ -4629,6 +4658,12 @@ public class PackageParser { return s; } private boolean isWebBrowsableIntent(IntentInfo intent) { return intent.hasAction(Intent.ACTION_VIEW) && intent.hasCategory(Intent.CATEGORY_BROWSABLE) && (intent.hasDataScheme("http") || intent.hasDataScheme("https")); } private boolean parseAllMetaData(Resources res, XmlResourceParser parser, String tag, Component<?> outInfo, String[] outError) throws XmlPullParserException, IOException { int outerDepth = parser.getDepth(); Loading