diff options
author | Craig Mautner <cmautner@google.com> | 2013-10-10 00:20:08 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-10-10 00:20:08 +0000 |
commit | 4ca2aec2be70026a2f8feee258405647985dc389 (patch) | |
tree | d1d5bf674b75ce4d75dd33c4d77bb0709cd13fb9 /services/java/com/android/server | |
parent | f681058f2dc08ebfbde93f30b160d5d53f104c99 (diff) | |
parent | 8e79734ba371e123a63de3ac993fc3cae201a592 (diff) | |
download | frameworks_base-4ca2aec2be70026a2f8feee258405647985dc389.zip frameworks_base-4ca2aec2be70026a2f8feee258405647985dc389.tar.gz frameworks_base-4ca2aec2be70026a2f8feee258405647985dc389.tar.bz2 |
Merge "Add task to list before looking it up." into klp-dev
Diffstat (limited to 'services/java/com/android/server')
-rw-r--r-- | services/java/com/android/server/wm/WindowManagerService.java | 31 |
1 files changed, 4 insertions, 27 deletions
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java index 0fc10f9..aa8851c 100644 --- a/services/java/com/android/server/wm/WindowManagerService.java +++ b/services/java/com/android/server/wm/WindowManagerService.java @@ -3386,9 +3386,9 @@ public class WindowManagerService extends IWindowManager.Stub throw new IllegalArgumentException("addAppToken: invalid stackId=" + stackId); } Task task = new Task(atoken, stack, userId); + mTaskIdToTask.put(taskId, task); stack.addTask(task, true); stack.getDisplayContent().moveStack(stack, true); - mTaskIdToTask.put(taskId, task); return task; } @@ -4724,23 +4724,6 @@ public class WindowManagerService extends IWindowManager.Stub return index; } - private void moveHomeTasksLocked(boolean toTop) { - final DisplayContent displayContent = getDefaultDisplayContentLocked(); - if (toTop ^ displayContent.homeOnTop()) { - final ArrayList<Task> tasks = displayContent.getHomeStack().getTasks(); - final int numTasks = tasks.size(); - for (int i = 0; i < numTasks; ++i) { - if (toTop) { - // Keep pulling the bottom task off and moving it to the top. - moveTaskToTop(tasks.get(0).taskId); - } else { - // Keep pulling the top task off and moving it to the bottom. - moveTaskToBottom(tasks.get(numTasks - 1).taskId); - } - } - } - } - void moveStackWindowsLocked(TaskStack stack) { DisplayContent displayContent = stack.getDisplayContent(); @@ -4797,15 +4780,9 @@ public class WindowManagerService extends IWindowManager.Stub final TaskStack stack = task.mStack; final DisplayContent displayContent = task.getDisplayContent(); final boolean isHomeStackTask = stack.isHomeStack(); - final boolean homeIsOnTop = displayContent.homeOnTop(); - if (!isHomeStackTask && homeIsOnTop) { - // First move move the home tasks all to the bottom to rearrange the windows. - moveHomeTasksLocked(false); - // Now move the stack itself. - displayContent.moveHomeStackBox(false); - } else if (isHomeStackTask && !homeIsOnTop) { - // Move the stack to the top. - displayContent.moveHomeStackBox(true); + if (isHomeStackTask != displayContent.homeOnTop()) { + // First move the stack itself. + displayContent.moveHomeStackBox(isHomeStackTask); } stack.moveTaskToTop(task); displayContent.moveStack(stack, true); |