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

Commit dad85a6c authored by Amith Yamasani's avatar Amith Yamasani Committed by Android (Google) Code Review
Browse files

Merge "Allow user shutdown broadcasts to be delivered" into lmp-mr1-dev

parents c6de3212 0d2ebc29
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -15700,11 +15700,13 @@ public final class ActivityManagerService extends ActivityManagerNative
                true, ALLOW_NON_FULL, "broadcast", callerPackage);
        // Make sure that the user who is receiving this broadcast is running.
        // If not, we will just skip it.
        // If not, we will just skip it. Make an exception for shutdown broadcasts
        // and upgrade steps.
        if (userId != UserHandle.USER_ALL && !isUserRunningLocked(userId, false)) {
            if (callingUid != Process.SYSTEM_UID || (intent.getFlags()
                    & Intent.FLAG_RECEIVER_BOOT_UPGRADE) == 0) {
            if ((callingUid != Process.SYSTEM_UID
                    || (intent.getFlags() & Intent.FLAG_RECEIVER_BOOT_UPGRADE) == 0)
                    && !Intent.ACTION_SHUTDOWN.equals(intent.getAction())) {
                Slog.w(TAG, "Skipping broadcast of " + intent
                        + ": user " + userId + " is stopped");
                return ActivityManager.BROADCAST_FAILED_USER_STOPPED;