summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorCraig Mautner <cmautner@google.com>2014-10-15 23:40:11 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-10-15 23:40:11 +0000
commit87441860bf4df2da7ce4537ad31c8240547da655 (patch)
tree22f6a5928e715d7521052b63be07cddea947b62b /services
parent3d4aec1bb79caea6fadc36a942fb0c0f84a0f4f2 (diff)
parente52791055c855a957cad767dfa9889faae86660c (diff)
downloadframeworks_base-87441860bf4df2da7ce4537ad31c8240547da655.zip
frameworks_base-87441860bf4df2da7ce4537ad31c8240547da655.tar.gz
frameworks_base-87441860bf4df2da7ce4537ad31c8240547da655.tar.bz2
am e5279105: Merge "Move desired task to top if not already there." into lmp-dev
* commit 'e52791055c855a957cad767dfa9889faae86660c': Move desired task to top if not already there.
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/am/ActivityStackSupervisor.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
index bbfb62a..879ddc0 100644
--- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
@@ -2058,7 +2058,13 @@ public final class ActivityStackSupervisor implements DisplayListener {
}
targetStack = sourceTask.stack;
targetStack.moveToFront();
- mWindowManager.moveTaskToTop(targetStack.topTask().taskId);
+ final TaskRecord topTask = targetStack.topTask();
+ if (topTask != sourceTask) {
+ targetStack.moveTaskToFrontLocked(sourceTask, r, options);
+ Slog.w(TAG, "top task and source task don't match. would have caused anr");
+ } else {
+ mWindowManager.moveTaskToTop(topTask.taskId);
+ }
if (!addingToTask && (launchFlags&Intent.FLAG_ACTIVITY_CLEAR_TOP) != 0) {
// In this case, we are adding the activity to an existing
// task, but the caller has asked to clear that task if the
@@ -3097,10 +3103,9 @@ public final class ActivityStackSupervisor implements DisplayListener {
for (int displayNdx = 0; displayNdx < mActivityDisplays.size(); ++displayNdx) {
ActivityDisplay activityDisplay = mActivityDisplays.valueAt(displayNdx);
pw.print("Display #"); pw.print(activityDisplay.mDisplayId);
- pw.println(" (activities from bottom to top):");
+ pw.println(" (activities from top to bottom):");
ArrayList<ActivityStack> stacks = activityDisplay.mStacks;
- final int numStacks = stacks.size();
- for (int stackNdx = 0; stackNdx < numStacks; ++stackNdx) {
+ for (int stackNdx = stacks.size() - 1; stackNdx >= 0; --stackNdx) {
final ActivityStack stack = stacks.get(stackNdx);
StringBuilder stackHeader = new StringBuilder(128);
stackHeader.append(" Stack #");