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

Commit daded427 authored by Mugdha Lakhani's avatar Mugdha Lakhani Committed by Automerger Merge Worker
Browse files

DO NOT MERGE Isolated processes must fail registering BRs. am: ca49ddc0

parents 3a21e8d4 ca49ddc0
Loading
Loading
Loading
Loading
+9 −4
Original line number Original line Diff line number Diff line
@@ -13081,12 +13081,17 @@ public class ActivityManagerService extends IActivityManager.Stub
    public Intent registerReceiverWithFeature(IApplicationThread caller, String callerPackage,
    public Intent registerReceiverWithFeature(IApplicationThread caller, String callerPackage,
            String callerFeatureId, String receiverId, IIntentReceiver receiver,
            String callerFeatureId, String receiverId, IIntentReceiver receiver,
            IntentFilter filter, String permission, int userId, int flags) {
            IntentFilter filter, String permission, int userId, int flags) {
        // Allow Sandbox process to register only unexported receivers.
        if ((flags & Context.RECEIVER_NOT_EXPORTED) != 0) {
        enforceNotIsolatedCaller("registerReceiver");
        enforceNotIsolatedCaller("registerReceiver");
        } else if (mSdkSandboxSettings.isBroadcastReceiverRestrictionsEnforced()) {
            enforceNotIsolatedOrSdkSandboxCaller("registerReceiver");
        // Allow Sandbox process to register only unexported receivers.
        boolean unexported = (flags & Context.RECEIVER_NOT_EXPORTED) != 0;
        if (mSdkSandboxSettings.isBroadcastReceiverRestrictionsEnforced()
                && Process.isSdkSandboxUid(Binder.getCallingUid())
                && !unexported) {
            throw new SecurityException("SDK sandbox process not allowed to call "
                + "registerReceiver");
        }
        }
        ArrayList<Intent> stickyIntents = null;
        ArrayList<Intent> stickyIntents = null;
        ProcessRecord callerApp = null;
        ProcessRecord callerApp = null;
        final boolean visibleToInstantApps
        final boolean visibleToInstantApps