diff options
| author | 2014-12-10 00:30:29 +0000 | |
|---|---|---|
| committer | 2014-12-10 00:30:31 +0000 | |
| commit | dad85a6c4bf51c126978d584703a5320be7f396c (patch) | |
| tree | c0ed69f317b3109218a5113992147c3f450e803f | |
| parent | c6de3212c2dd8638bf3150719ed331673fdcab06 (diff) | |
| parent | 0d2ebc29689cc7cb8a5447c38ac01fe433ed693b (diff) | |
Merge "Allow user shutdown broadcasts to be delivered" into lmp-mr1-dev
| -rwxr-xr-x | services/core/java/com/android/server/am/ActivityManagerService.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index 0373611bfbde..1227148421af 100755 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -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; |