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

Commit 346d9f1a authored by Svet Ganov's avatar Svet Ganov Committed by android-build-merger
Browse files

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

am: 93ec4f82

Change-Id: Icdb0079006db75d16f48d6955e06edc0bb5c05c0
parents 1cf7c2e6 93ec4f82
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -20904,9 +20904,15 @@ public class ActivityManagerService extends IActivityManager.Stub
    }
    private List<ResolveInfo> collectReceiverComponents(Intent intent, String resolvedType,
            int callingUid, int[] users) {
            int callingUid, boolean callerInstantApp, 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 {
@@ -21535,7 +21541,8 @@ 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, users);
            receivers = collectReceiverComponents(intent, resolvedType, callingUid,
                    callerInstantApp, users);
        }
        if (intent.getComponent() == null) {
            if (userId == UserHandle.USER_ALL && callingUid == SHELL_UID) {