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

Commit a2c978b5 authored by Svetoslav Ganov's avatar Svetoslav Ganov Committed by android-build-merger
Browse files

Merge "Revert "Allow instant apps to send broadcasts to themselves"" into pi-dev

am: 97995da6

Change-Id: I014e8de99a78a489f1f32738429d1cb0cebc4076
parents aaec389c 97995da6
Loading
Loading
Loading
Loading
+2 −9
Original line number Diff line number Diff line
@@ -20905,15 +20905,9 @@ public class ActivityManagerService extends IActivityManager.Stub
    }
    private List<ResolveInfo> collectReceiverComponents(Intent intent, String resolvedType,
            int callingUid, boolean callerInstantApp, int[] users) {
            int callingUid, int[] users) {
        // TODO: come back and remove this assumption to triage all broadcasts
        int pmFlags = STOCK_PM_FLAGS | MATCH_DEBUG_TRIAGED_MISSING;
        // Instant apps should be able to send broadcasts to themselves, so we would
        // match instant receivers and later the broadcast queue would enforce that
        // the broadcast cannot be sent to a receiver outside the instant UID.
        if (callerInstantApp) {
            pmFlags |= PackageManager.MATCH_INSTANT;
        }
        List<ResolveInfo> receivers = null;
        try {
@@ -21542,8 +21536,7 @@ public class ActivityManagerService extends IActivityManager.Stub
        // Need to resolve the intent to interested receivers...
        if ((intent.getFlags()&Intent.FLAG_RECEIVER_REGISTERED_ONLY)
                 == 0) {
            receivers = collectReceiverComponents(intent, resolvedType, callingUid,
                    callerInstantApp, users);
            receivers = collectReceiverComponents(intent, resolvedType, callingUid, users);
        }
        if (intent.getComponent() == null) {
            if (userId == UserHandle.USER_ALL && callingUid == SHELL_UID) {