Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 65cf224a authored by Chad Brubaker's avatar Chad Brubaker Committed by android-build-merger
Browse files

Merge "Implicitly expose SEND intents to Instant Apps" into oc-dev am: 8ee12087

am: 4ad2d2b4

Change-Id: I784ba8d936046e65bcec1612ba77ff8aaba26975
parents 61bfec0c 4ad2d2b4
Loading
Loading
Loading
Loading
+10 −7
Original line number Diff line number Diff line
@@ -4306,7 +4306,7 @@ public class PackageParser {
                    a.intents.add(intent);
                }
                // adjust activity flags when we implicitly expose it via a browsable filter
                intent.setVisibleToInstantApp(visibleToEphemeral || isWebBrowsableIntent(intent));
                intent.setVisibleToInstantApp(visibleToEphemeral || isImplicitlyExposedIntent(intent));
                if (intent.isVisibleToInstantApp()) {
                    a.info.flags |= ActivityInfo.FLAG_VISIBLE_TO_EPHEMERAL;
                }
@@ -4339,7 +4339,7 @@ public class PackageParser {
                    owner.preferredActivityFilters.add(intent);
                }
                // adjust activity flags when we implicitly expose it via a browsable filter
                intent.setVisibleToInstantApp(visibleToEphemeral || isWebBrowsableIntent(intent));
                intent.setVisibleToInstantApp(visibleToEphemeral || isImplicitlyExposedIntent(intent));
                if (intent.isVisibleToInstantApp()) {
                    a.info.flags |= ActivityInfo.FLAG_VISIBLE_TO_EPHEMERAL;
                }
@@ -4667,7 +4667,7 @@ public class PackageParser {
                            + parser.getPositionDescription());
                } else {
                    intent.setVisibleToInstantApp(
                            visibleToEphemeral || isWebBrowsableIntent(intent));
                            visibleToEphemeral || isImplicitlyExposedIntent(intent));
                    a.intents.add(intent);
                }
                // adjust activity flags when we implicitly expose it via a browsable filter
@@ -4869,7 +4869,7 @@ public class PackageParser {
                }
                outInfo.intents.add(intent);
                // adjust provider flags when we implicitly expose it via a browsable filter
                intent.setVisibleToInstantApp(visibleToEphemeral || isWebBrowsableIntent(intent));
                intent.setVisibleToInstantApp(visibleToEphemeral || isImplicitlyExposedIntent(intent));
                if (intent.isVisibleToInstantApp()) {
                    outInfo.info.flags |= ProviderInfo.FLAG_VISIBLE_TO_EPHEMERAL;
                }
@@ -5174,7 +5174,7 @@ public class PackageParser {
                    return null;
                }
                // adjust activity flags when we implicitly expose it via a browsable filter
                intent.setVisibleToInstantApp(visibleToEphemeral || isWebBrowsableIntent(intent));
                intent.setVisibleToInstantApp(visibleToEphemeral || isImplicitlyExposedIntent(intent));
                if (intent.isVisibleToInstantApp()) {
                    s.info.flags |= ServiceInfo.FLAG_VISIBLE_TO_EPHEMERAL;
                }
@@ -5215,8 +5215,11 @@ public class PackageParser {
        return s;
    }

    private boolean isWebBrowsableIntent(IntentInfo intent) {
        return intent.hasCategory(Intent.CATEGORY_BROWSABLE);
    private boolean isImplicitlyExposedIntent(IntentInfo intent) {
        return intent.hasCategory(Intent.CATEGORY_BROWSABLE)
                || intent.hasAction(Intent.ACTION_SEND)
                || intent.hasAction(Intent.ACTION_SENDTO)
                || intent.hasAction(Intent.ACTION_SEND_MULTIPLE);
    }

    private boolean parseAllMetaData(Resources res, XmlResourceParser parser, String tag,