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

Commit 68ea4721 authored by Jacob Hobbie's avatar Jacob Hobbie
Browse files

Allowing sticky broadcasts for null receivers to be received/registered

for without requiring a RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED flag.

Test: will be added with enforcement
Bug: 161145287
Change-Id: I289a646f14b44e5e63bbf48f7e3e0db1dfba0d3d
parent 12f6d7d9
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -12558,8 +12558,11 @@ public class ActivityManagerService extends IActivityManager.Stub
            }
            // If the change is enabled, but neither exported or not exported is set, we need to log
            // an error so the consumer can know to explicitly set the value for their flag
            if (!onlyProtectedBroadcasts && (Compatibility.isChangeEnabled(
            // an error so the consumer can know to explicitly set the value for their flag.
            // If the caller is registering for a sticky broadcast with a null receiver, we won't
            // require a flag
            if (!onlyProtectedBroadcasts && receiver != null && (
                    Compatibility.isChangeEnabled(
                            DYNAMIC_RECEIVER_EXPLICIT_EXPORT_REQUIRED)
                            && (flags & (Context.RECEIVER_EXPORTED | Context.RECEIVER_NOT_EXPORTED))
                            == 0)) {