Move stack to front in-sync with task reparenting

When reparenting a task to another stack have window manager move the
destination stack to the front at the same time it is reparenting the
task if REPARENT_MOVE_STACK_TO_FRONT is set to avoid jank.

Test: manual
Bug: 37299899
Change-Id: I45678e742188a4871f93a11178f7ab2b60c7bcc3
diff --git a/services/core/java/com/android/server/wm/TaskWindowContainerController.java b/services/core/java/com/android/server/wm/TaskWindowContainerController.java
index efc2e11..9f02485 100644
--- a/services/core/java/com/android/server/wm/TaskWindowContainerController.java
+++ b/services/core/java/com/android/server/wm/TaskWindowContainerController.java
@@ -121,7 +121,7 @@
         }
     }
 
-    public void reparent(StackWindowController stackController, int position) {
+    public void reparent(StackWindowController stackController, int position, boolean moveParents) {
         synchronized (mWindowMap) {
             if (DEBUG_STACK) Slog.i(TAG_WM, "reparent: moving taskId=" + mTaskId
                     + " to stack=" + stackController + " at " + position);
@@ -135,7 +135,7 @@
                 throw new IllegalArgumentException("reparent: could not find stack="
                         + stackController);
             }
-            mContainer.reparent(stack, position);
+            mContainer.reparent(stack, position, moveParents);
             mContainer.getDisplayContent().layoutAndAssignWindowLayersIfNeeded();
         }
     }