From 47fa6ae96ca257cdf2f4b833d5c530ee2b6f4c3a Mon Sep 17 00:00:00 2001 From: Matthew Ng Date: Tue, 7 Feb 2017 13:15:10 -0800 Subject: [PATCH] Fixes dragging divider up in splitscreen puts the docked stack behind Fixes the regression introduced in ag/1721556 where the docked app would be placed on top of all the other apps when it should be placed behind everything. Change-Id: I63fc3bcfd0ef93f6ac8509a4268b628d9b0eb46b Fixes: 34697887 Test: manual - split screen and drag up to dismiss --- .../java/com/android/server/am/ActivityStackSupervisor.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java index e954363a936bd..0b1c3d5678f4e 100644 --- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java +++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java @@ -2301,7 +2301,9 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D } else { for (int i = 0; i < size; i++) { final TaskRecord task = tasks.get(i); - task.reparent(FULLSCREEN_WORKSPACE_STACK_ID, MAX_VALUE, + final int position = fullscreenStack != null ? + Math.max(fullscreenStack.getAllTasks().size() - 1, 0) : 0; + task.reparent(FULLSCREEN_WORKSPACE_STACK_ID, position, "moveTasksToFullscreenStack - NOT_onTop"); } }