Fixes the animation and state when docking a task by drag

There was 3 issues in this bug.

First the wrong stack id was used to defer and continue updating bounds
that broke a lot of the animation. This was fixed by using the recents
stack id instead of home.

Secondly, the wrong transit was passed into AppTransition.java getting
the wrong animation for recents to be docked, defering surface layouts
ensures that the correct transition is gained in that transaction.

Lastly, remove the starting window for the docked-by-drag-from-recents
transition because it was causing the window container to freeze its
bounds causing clipping issues and 2 flickers (where it appears over
the thumbnail) during the animation. Added a TODO to fix it later.

Test: go/wm-smoke
Bug: 34099271
Change-Id: Iaf0dffe5c2f5108c9946c9ea23c6e3fd6a49c34d
diff --git a/services/core/java/com/android/server/wm/AppWindowContainerController.java b/services/core/java/com/android/server/wm/AppWindowContainerController.java
index 6640184..8cfbf68 100644
--- a/services/core/java/com/android/server/wm/AppWindowContainerController.java
+++ b/services/core/java/com/android/server/wm/AppWindowContainerController.java
@@ -18,6 +18,8 @@
 
 import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
 import static android.view.WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
+
+import static com.android.server.wm.AppTransition.TRANSIT_DOCK_TASK_FROM_RECENTS;
 import static com.android.server.wm.AppTransition.TRANSIT_UNSET;
 import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ADD_REMOVE;
 import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_APP_TRANSITIONS;
@@ -581,8 +583,12 @@
 
     private int getStartingWindowType(boolean newTask, boolean taskSwitch, boolean processRunning,
             boolean allowTaskSnapshot, boolean activityCreated) {
-        if (newTask || !processRunning
-                || (taskSwitch && !activityCreated)) {
+        if (mService.mAppTransition.getAppTransition() == TRANSIT_DOCK_TASK_FROM_RECENTS) {
+            // TODO(b/34099271): Remove this statement to add back the starting window and figure
+            // out why it causes flickering, the starting window appears over the thumbnail while
+            // the docked from recents transition occurs
+            return STARTING_WINDOW_TYPE_NONE;
+        } else if (newTask || !processRunning || (taskSwitch && !activityCreated)) {
             return STARTING_WINDOW_TYPE_SPLASH_SCREEN;
         } else if (taskSwitch && allowTaskSnapshot) {
             return STARTING_WINDOW_TYPE_SNAPSHOT;