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

Commit 904870f0 authored by Palak Chaudhary's avatar Palak Chaudhary
Browse files

Check broadcasts sent from sandbox process UID for intents without an

action as well

Bug: b/266069199
Test: atest SdkSandboxRestrictionsTest#testSendBroadcastsRestrictions_withAction
atets SdkSandboxRestrictionsTest#testSendBroadcastRestrictions_withoutAction

Change-Id: Iac8b00ae03216739f1a8975b6887491a62c1c711
parent ac6cd614
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -14254,16 +14254,6 @@ public class ActivityManagerService extends IActivityManager.Stub
            }
        }
        boolean timeoutExempt = false;
        if (action != null) {
            if (getBackgroundLaunchBroadcasts().contains(action)) {
                if (DEBUG_BACKGROUND_CHECK) {
                    Slog.i(TAG, "Broadcast action " + action + " forcing include-background");
                }
                intent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
            }
        if (Process.isSdkSandboxUid(realCallingUid)) {
            SdkSandboxManagerLocal sdkSandboxManagerLocal = LocalManagerRegistry.getManager(
                    SdkSandboxManagerLocal.class);
@@ -14274,6 +14264,16 @@ public class ActivityManagerService extends IActivityManager.Stub
            sdkSandboxManagerLocal.enforceAllowedToSendBroadcast(intent);
        }
        boolean timeoutExempt = false;
        if (action != null) {
            if (getBackgroundLaunchBroadcasts().contains(action)) {
                if (DEBUG_BACKGROUND_CHECK) {
                    Slog.i(TAG, "Broadcast action " + action + " forcing include-background");
                }
                intent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
            }
            switch (action) {
                case Intent.ACTION_MEDIA_SCANNER_SCAN_FILE:
                    UserManagerInternal umInternal = LocalServices.getService(