diff options
| author | 2014-07-31 16:04:18 +0000 | |
|---|---|---|
| committer | 2014-07-29 21:36:05 +0000 | |
| commit | 4895bf78ffd44ba076e4bc9805e43ce834f84b1e (patch) | |
| tree | 99644f0853a907c706ad0754f3bf59be37ba808d | |
| parent | bd855367c41d588e9a3305d188707dde5b2c0a0a (diff) | |
| parent | 26ac40305aac2ecb176e45485a2cebd3111c2dd9 (diff) | |
Merge "Fix a bug that the RecentTask list of other’s may show up to non-primary users."
| -rw-r--r-- | services/java/com/android/server/am/ActivityManagerService.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java index 0751c2b3e816..dea41e48c4b6 100644 --- a/services/java/com/android/server/am/ActivityManagerService.java +++ b/services/java/com/android/server/am/ActivityManagerService.java @@ -3355,6 +3355,24 @@ public final class ActivityManagerService extends ActivityManagerNative return ret; } + //explicitly remove thd old information in mRecentTasks when removing existing user. + private void removeRecentTaskLocked(int userId) { + if(userId <= 0) { + Slog.i(TAG, "Can't remove recent task on user " + userId); + return; + } + + for (int i = mRecentTasks.size() - 1; i >= 0; --i) { + TaskRecord tr = mRecentTasks.get(i); + if (tr.userId == userId) { + if(DEBUG_TASKS) Slog.i(TAG, "remove RecentTask " + tr + + " when finishing user" + userId); + tr.disposeThumbnail(); + mRecentTasks.remove(i); + } + } + } + final void addRecentTaskLocked(TaskRecord task) { int N = mRecentTasks.size(); // Quick case: check if the top-most recent task is the same. @@ -16503,6 +16521,8 @@ public final class ActivityManagerService extends ActivityManagerNative // Kill all the processes for the user. forceStopUserLocked(userId, "finish user"); } + //explicitly remove the old information in mRecentTasks when removing existing user. + removeRecentTaskLocked(userId); } for (int i=0; i<callbacks.size(); i++) { |