summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/am
diff options
context:
space:
mode:
authorCraig Mautner <cmautner@google.com>2013-10-21 20:05:26 -0700
committerCraig Mautner <cmautner@google.com>2013-10-21 20:05:26 -0700
commit19d9bd54d3d09075b3fd5c57a5e4fc1a16f9c826 (patch)
tree3a8acaabad5016eecafed559f5d1c38de5e91786 /services/java/com/android/server/am
parenta80d6424987602cc3141d4cb4cdee21a54747691 (diff)
downloadbase-19d9bd54d3d09075b3fd5c57a5e4fc1a16f9c826.tar.gz
Do not delete stacks that are not empty.
The possibility existed that an activity was set to a task that it was already being set to. If that were to happen, and it was the only activity in the only task of the stack the stack would be deleted. This fixes that situation and logs it as well to confirm that it does fix bug 11272935. Logging to be deleted upon successful monkey run exhibiting the log. Change-Id: I436fdcc9a3734adad81d3ef90f29b93b3ac4dfcd
Diffstat (limited to 'services/java/com/android/server/am')
-rw-r--r--services/java/com/android/server/am/ActivityRecord.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/services/java/com/android/server/am/ActivityRecord.java b/services/java/com/android/server/am/ActivityRecord.java
index cf686672a2a3..49f29fe6c372 100644
--- a/services/java/com/android/server/am/ActivityRecord.java
+++ b/services/java/com/android/server/am/ActivityRecord.java
@@ -480,7 +480,12 @@ final class ActivityRecord {
void setTask(TaskRecord newTask, ThumbnailHolder newThumbHolder, boolean isRoot) {
if (task != null && task.removeActivity(this)) {
- mStackSupervisor.removeTask(task);
+ if (task != newTask) {
+ mStackSupervisor.removeTask(task);
+ } else {
+ Slog.d(TAG, "!!! REMOVE THIS LOG !!! setTask: nearly removed stack=" +
+ (newTask == null ? null : newTask.stack));
+ }
}
if (inHistory && !finishing) {
if (task != null) {