am 3cb55598: Merge "Fix issue #5139085: Some Recents items can\'t be killed"

* commit '3cb55598500be4cb3ae654cc2950a9338fb01a6a':
  Fix issue #5139085: Some Recents items can't be killed
This commit is contained in:
Dianne Hackborn
2011-09-08 14:02:48 -07:00
committed by Android Git Automerger
2 changed files with 37 additions and 11 deletions

View File

@@ -5171,6 +5171,29 @@ public final class ActivityManagerService extends ActivityManagerNative
cleanUpRemovedTaskLocked(r,
(flags&ActivityManager.REMOVE_TASK_KILL_PROCESS) != 0);
return true;
} else {
TaskRecord tr = null;
int i=0;
while (i < mRecentTasks.size()) {
TaskRecord t = mRecentTasks.get(i);
if (t.taskId == taskId) {
tr = t;
break;
}
i++;
}
if (tr != null) {
if (tr.numActivities <= 0) {
// Caller is just removing a recent task that is
// not actively running. That is easy!
mRecentTasks.remove(i);
} else {
Slog.w(TAG, "removeTask: task " + taskId
+ " does not have activities to remove, "
+ " but numActivities=" + tr.numActivities
+ ": " + tr);
}
}
}
} finally {
Binder.restoreCallingIdentity(ident);