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

Commit 1883de04 authored by Ben Gruver's avatar Ben Gruver Committed by Android Git Automerger
Browse files

am 49660c7c: Add support for broadcast intents

* commit '49660c7c':
  Add support for broadcast intents
parents 7bd12d5d 49660c7c
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -12371,7 +12371,7 @@ public final class ActivityManagerService extends ActivityManagerNative
                    Intent intent = (Intent)allSticky.get(i);
                    BroadcastQueue queue = broadcastQueueForIntent(intent);
                    BroadcastRecord r = new BroadcastRecord(queue, intent, null,
                            null, -1, -1, null, AppOpsManager.OP_NONE, receivers, null, 0,
                            null, -1, -1, null, null, AppOpsManager.OP_NONE, receivers, null, 0,
                            null, null, false, true, true, -1);
                    queue.enqueueParallelBroadcastLocked(r);
                    queue.scheduleBroadcastsLocked();
@@ -12804,8 +12804,8 @@ public final class ActivityManagerService extends ActivityManagerNative
            // components to be launched.
            final BroadcastQueue queue = broadcastQueueForIntent(intent);
            BroadcastRecord r = new BroadcastRecord(queue, intent, callerApp,
                    callerPackage, callingPid, callingUid, requiredPermission, appOp,
                    registeredReceivers, resultTo, resultCode, resultData, map,
                    callerPackage, callingPid, callingUid, resolvedType, requiredPermission,
                    appOp, registeredReceivers, resultTo, resultCode, resultData, map,
                    ordered, sticky, false, userId);
            if (DEBUG_BROADCAST) Slog.v(
                    TAG, "Enqueueing parallel broadcast " + r);
@@ -12894,9 +12894,9 @@ public final class ActivityManagerService extends ActivityManagerNative
                || resultTo != null) {
            BroadcastQueue queue = broadcastQueueForIntent(intent);
            BroadcastRecord r = new BroadcastRecord(queue, intent, callerApp,
                    callerPackage, callingPid, callingUid, requiredPermission, appOp,
                    receivers, resultTo, resultCode, resultData, map, ordered,
                    sticky, false, userId);
                    callerPackage, callingPid, callingUid, resolvedType,
                    requiredPermission, appOp, receivers, resultTo, resultCode,
                    resultData, map, ordered, sticky, false, userId);
            if (DEBUG_BROADCAST) Slog.v(
                    TAG, "Enqueueing ordered broadcast " + r
                    + ": prev had " + queue.mOrderedBroadcasts.size());
+8 −0
Original line number Diff line number Diff line
@@ -421,6 +421,10 @@ public final class BroadcastQueue {
                skip = true;
            }
        }
        if (!skip) {
            skip = !mService.mIntentFirewall.checkBroadcast(r.intent, r.callingUid,
                    r.callingPid, r.resolvedType, filter.receiverList.uid);
        }

        if (!skip) {
            // If this is not being sent as an ordered broadcast, then we
@@ -729,6 +733,10 @@ public final class BroadcastQueue {
                    skip = true;
                }
            }
            if (!skip) {
                skip = !mService.mIntentFirewall.checkBroadcast(r.intent, r.callingUid,
                        r.callingPid, r.resolvedType, info.activityInfo.applicationInfo.uid);
            }
            boolean isSingleton = false;
            try {
                isSingleton = mService.isSingleton(info.activityInfo.processName,
+4 −2
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ final class BroadcastRecord extends Binder {
    final boolean sticky;   // originated from existing sticky data?
    final boolean initialSticky; // initial broadcast from register to sticky?
    final int userId;       // user id this broadcast was for
    final String resolvedType; // the resolved data type
    final String requiredPermission; // a permission the caller has required
    final int appOp;        // an app op that is associated with this broadcast
    final List receivers;   // contains BroadcastFilter and ResolveInfo
@@ -171,8 +172,8 @@ final class BroadcastRecord extends Binder {

    BroadcastRecord(BroadcastQueue _queue,
            Intent _intent, ProcessRecord _callerApp, String _callerPackage,
            int _callingPid, int _callingUid, String _requiredPermission, int _appOp,
            List _receivers, IIntentReceiver _resultTo, int _resultCode,
            int _callingPid, int _callingUid, String _resolvedType, String _requiredPermission,
            int _appOp, List _receivers, IIntentReceiver _resultTo, int _resultCode,
            String _resultData, Bundle _resultExtras, boolean _serialized,
            boolean _sticky, boolean _initialSticky,
            int _userId) {
@@ -183,6 +184,7 @@ final class BroadcastRecord extends Binder {
        callerPackage = _callerPackage;
        callingPid = _callingPid;
        callingUid = _callingUid;
        resolvedType = _resolvedType;
        requiredPermission = _requiredPermission;
        appOp = _appOp;
        receivers = _receivers;
+2 −3
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ package com.android.server.firewall;

import android.content.ComponentName;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

@@ -27,10 +26,10 @@ import java.io.IOException;
class AndFilter extends FilterList {
    @Override
    public boolean matches(IntentFirewall ifw, ComponentName resolvedComponent, Intent intent,
            int callerUid, int callerPid, String resolvedType, ApplicationInfo resolvedApp) {
            int callerUid, int callerPid, String resolvedType, int receivingUid) {
        for (int i=0; i<children.size(); i++) {
            if (!children.get(i).matches(ifw, resolvedComponent, intent, callerUid, callerPid,
                    resolvedType, resolvedApp)) {
                    resolvedType, receivingUid)) {
                return false;
            }
        }
+1 −2
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ package com.android.server.firewall;

import android.content.ComponentName;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

@@ -36,7 +35,7 @@ class CategoryFilter implements Filter {

    @Override
    public boolean matches(IntentFirewall ifw, ComponentName resolvedComponent, Intent intent,
            int callerUid, int callerPid, String resolvedType, ApplicationInfo resolvedApp) {
            int callerUid, int callerPid, String resolvedType, int receivingUid) {
        Set<String> categories = intent.getCategories();
        if (categories == null) {
            return false;
Loading