summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWale Ogunwale <ogunwale@google.com>2015-06-10 12:03:23 -0700
committerWale Ogunwale <ogunwale@google.com>2015-06-10 12:03:23 -0700
commit6eeed830e33d4194bb10285c57b73b36db5dbbd9 (patch)
tree61caffb3c41d21c060b6d9a698ffe93e8cd0670d
parentcefc16df98a985b8a7c40bca5d5ff3fde6b42dbf (diff)
downloadframeworks_base-6eeed830e33d4194bb10285c57b73b36db5dbbd9.zip
frameworks_base-6eeed830e33d4194bb10285c57b73b36db5dbbd9.tar.gz
frameworks_base-6eeed830e33d4194bb10285c57b73b36db5dbbd9.tar.bz2
Revert "Revert "Recompute focus stack if cleared while starting an activity.""
This reverts commit 47e53319509474c2f00847ac391dd32776712470. Some how the reverted CL made it into mnc-dev and and master when that was the intention... Bug: 21751387
-rw-r--r--services/core/java/com/android/server/am/ActivityStackSupervisor.java21
1 files changed, 14 insertions, 7 deletions
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
index 577a4f9..23e62e2 100644
--- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
@@ -2019,15 +2019,22 @@ public final class ActivityStackSupervisor implements DisplayListener {
r, top.task);
top.deliverNewIntentLocked(callingUid, r.intent, r.launchedFromPackage);
} else {
- // A special case: we need to
- // start the activity because it is not currently
- // running, and the caller has asked to clear the
- // current task to have this activity at the top.
+ // A special case: we need to start the activity because it is not
+ // currently running, and the caller has asked to clear the current
+ // task to have this activity at the top.
addingToTask = true;
- // Now pretend like this activity is being started
- // by the top of its task, so it is put in the
- // right place.
+ // Now pretend like this activity is being started by the top of its
+ // task, so it is put in the right place.
sourceRecord = intentActivity;
+ TaskRecord task = sourceRecord.task;
+ if (task != null && task.stack == null) {
+ // Target stack got cleared when we all activities were removed
+ // above. Go ahead and reset it.
+ targetStack = computeStackFocus(sourceRecord, false /* newTask */);
+ targetStack.addTask(
+ task, !launchTaskBehind /* toTop */, false /* moving */);
+ }
+
}
} else if (r.realActivity.equals(intentActivity.task.realActivity)) {
// In this case the top activity on the task is the