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

Commit 7f24579b authored by Your Name's avatar Your Name Committed by Jacob Hobbie
Browse files

Final changes for dynamic receivers.

No longer deliver broadcasts to unexported receivers from external apps.
If a receiver is registered for only protected broadcasts and does not
specify a flag by default, mark the receiver exported by default. If
there are no broadcast actions, consider the receiver to have only
protected broadcasts (or, not unprotected broadcasts).

Bug: 161145287
Test: presubmit
Change-Id: I085d32a8e8fa8bfc3b3b3e22f56546a3bf67d30c
parent 49081156
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -12783,7 +12783,7 @@ public class ActivityManagerService extends IActivityManager.Stub
                noAction.add(null);
                actions = noAction.iterator();
            }
            boolean onlyProtectedBroadcasts = actions.hasNext();
            boolean onlyProtectedBroadcasts = true;
            // Collect stickies of users and check if broadcast is only registered for protected
            // broadcasts
@@ -12857,6 +12857,8 @@ public class ActivityManagerService extends IActivityManager.Stub
                    // Change is not enabled, thus not targeting T+. Assume exported.
                    flags |= Context.RECEIVER_EXPORTED;
                }
            } else if ((flags & Context.RECEIVER_NOT_EXPORTED) == 0) {
                flags |= Context.RECEIVER_EXPORTED;
            }
        }
+1 −1
Original line number Diff line number Diff line
@@ -870,7 +870,7 @@ public final class BroadcastQueue {
                    + " due to receiver " + filter.receiverList.app
                    + " (uid " + filter.receiverList.uid + ")"
                    + " not specifying RECEIVER_EXPORTED");
            // skip = true;
            skip = true;
        }

        if (skip) {