diff options
author | Sergii Skorokhodov <sergii.skorokhodov@sonymobile.com> | 2014-11-11 08:22:18 +0100 |
---|---|---|
committer | Henrik Baard <henrik.baard@sonymobile.com> | 2014-12-03 08:36:26 +0100 |
commit | 9edcc7be49aa521ece6b7b5f04530a435211e2b5 (patch) | |
tree | ce2f52531682263019e055bafd2595d4bc3ab48b | |
parent | a58336f6c8aa44373485e5a6d7ec32677387a935 (diff) | |
download | base-9edcc7be49aa521ece6b7b5f04530a435211e2b5.tar.gz |
Correct check of is user running
Before the ActivityManagerService sends an intent or
starts an activity it checks if target user is in
mStartedUsers array.
When removing a non-owner user process the
UserStartedState instance will still be in mStartedUsers
array with mState STOPPING or SHUTDOWN.
This should be checked before sending an intent or start
an activity.
isUserRunningLocked(...) will interpret mState STOPPING
and SHUTDOWN as a non running user.
Change-Id: I1b51bcdb62bdd0f6dbe05dab4d529d4ad40d0d44
-rwxr-xr-x | services/core/java/com/android/server/am/ActivityManagerService.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index 8dfb3217c0af..a2165cdd4066 100755 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -9372,9 +9372,9 @@ public final class ActivityManagerService extends ActivityManagerNative "Attempt to launch content provider before system ready"); } - // Make sure that the user who owns this provider is started. If not, + // Make sure that the user who owns this provider is running. If not, // we don't want to allow it to run. - if (mStartedUsers.get(userId) == null) { + if (!isUserRunningLocked(userId, false)) { Slog.w(TAG, "Unable to launch app " + cpi.applicationInfo.packageName + "/" + cpi.applicationInfo.uid + " for provider " @@ -15440,10 +15440,10 @@ public final class ActivityManagerService extends ActivityManagerNative userId = handleIncomingUser(callingPid, callingUid, userId, true, ALLOW_NON_FULL, "broadcast", callerPackage); - // Make sure that the user who is receiving this broadcast is started. + // Make sure that the user who is receiving this broadcast is running. // If not, we will just skip it. - if (userId != UserHandle.USER_ALL && mStartedUsers.get(userId) == null) { + if (userId != UserHandle.USER_ALL && !isUserRunningLocked(userId, false)) { if (callingUid != Process.SYSTEM_UID || (intent.getFlags() & Intent.FLAG_RECEIVER_BOOT_UPGRADE) == 0) { Slog.w(TAG, "Skipping broadcast of " + intent |