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

Commit 90da5a7c authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Shuffle around shell protected broadcast checks.

If a shell is running as root, they should be able to send protected
broadcasts, but we still want to suppress Log.wtf() when sending
broadcasts from the shell.

Test: builds, boots
Bug: 34107119
Change-Id: Id475b2c9d98ca6a675ee1545ed324736f0587caf
parent bd439dce
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -17875,6 +17875,11 @@ public class ActivityManagerService extends IActivityManager.Stub
    private void checkBroadcastFromSystem(Intent intent, ProcessRecord callerApp,
            String callerPackage, int callingUid, boolean isProtectedBroadcast, List receivers) {
        if ((intent.getFlags() & Intent.FLAG_RECEIVER_FROM_SHELL) != 0) {
            // Don't yell about broadcasts sent via shell
            return;
        }
        final String action = intent.getAction();
        if (isProtectedBroadcast
                || Intent.ACTION_CLOSE_SYSTEM_DIALOGS.equals(action)
@@ -18018,11 +18023,7 @@ public class ActivityManagerService extends IActivityManager.Stub
            case Process.PHONE_UID:
            case Process.BLUETOOTH_UID:
            case Process.NFC_UID:
                if ((intent.getFlags() & Intent.FLAG_RECEIVER_FROM_SHELL) != 0) {
                    isCallerSystem = false;
                } else {
                isCallerSystem = true;
                }
                break;
            default:
                isCallerSystem = (callerApp != null) && callerApp.persistent;