From 1f5b92fd53ad0193235ae3e6cbc54a4120ac2457 Mon Sep 17 00:00:00 2001 From: Wale Ogunwale Date: Tue, 18 Jul 2017 06:33:01 -0700 Subject: [PATCH] Don't move stack to bottom when creating task at bottom When creating a task, only move the parents of the task if we are creating the task at the top of the stack. i.e. creating the task at the top of its stack will move the stack forward and creating the task at the bottom of the stack shouldn't move the stack backwards. Creating a task at the bottom is used for things like restoring a task from recents to use for other things and for background user, so shouldn't affect visibility of its parent stack. Change-Id: Ifcaf7c5a95294631dff675ac5c7d87f059b1792a Fixes: 62352722 Test: go/wm-smoke --- .../com/android/server/wm/TaskWindowContainerController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/TaskWindowContainerController.java b/services/core/java/com/android/server/wm/TaskWindowContainerController.java index 9f0248517e88d..54a6cc01c8315 100644 --- a/services/core/java/com/android/server/wm/TaskWindowContainerController.java +++ b/services/core/java/com/android/server/wm/TaskWindowContainerController.java @@ -80,7 +80,9 @@ public class TaskWindowContainerController final Task task = createTask(taskId, stack, userId, bounds, overrideConfig, resizeMode, supportsPictureInPicture, homeTask, taskDescription); final int position = toTop ? POSITION_TOP : POSITION_BOTTOM; - stack.addTask(task, position, showForAllUsers, true /* moveParents */); + // We only want to move the parents to the parents if we are creating this task at the + // top of its stack. + stack.addTask(task, position, showForAllUsers, toTop /* moveParents */); } }