Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3a649981 authored by Winson Chung's avatar Winson Chung
Browse files

Fixing issue with positioning tasks when moving to fullscreen.

- Previously, this code was incorrectly moving things to the top of the
  stack, though the stack was never moved to the front so it was never
  visible.  But as a result, testDisallowMultipleTasksInPinnedStack()
  was failing if there was already something in the fullscreen stack.

Bug: 36844394
Test: android.server.cts.ActivityManagerPinnedStackTests
Change-Id: I5108bf72b8760b187d0c92ec673bbe5cf9527e90
parent f3ff7b82
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -2397,10 +2397,10 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
            } else {
                for (int i = 0; i < size; i++) {
                    final TaskRecord task = tasks.get(i);
                    final int position = fullscreenStack != null
                            ? Math.max(fullscreenStack.getAllTasks().size() - 1, 0) : 0;
                    // Defer resume until all the tasks have been moved to the fullscreen stack
                    task.reparent(FULLSCREEN_WORKSPACE_STACK_ID, position,
                    // Position the tasks in the fullscreen stack in order at the bottom of the
                    // stack. Also defer resume until all the tasks have been moved to the
                    // fullscreen stack.
                    task.reparent(FULLSCREEN_WORKSPACE_STACK_ID, i /* position */,
                            REPARENT_LEAVE_STACK_IN_PLACE, !ANIMATE, DEFER_RESUME,
                            schedulePictureInPictureModeChange,
                            "moveTasksToFullscreenStack - NOT_onTop");