Don't add StageChangeRecord when stage task moves to back

We would add a StageChangeRecord for a closing task even when the task
transition change was TRANSIT_TO_BACK. When both of the split stages had
one child task each nothing would happen, but if one of the stages had
two child tasks we would enter logic that assumed that one of stages was
closed. This change adds a StageChangeRecord for a closing task only
when the transition mode is TRANSIT_CLOSE.

Bug: 314688953
Test: atest WMShellUnitTests
Test: Open Gmail and Chrome in split, go to the compose-email screen in
      Gmail, receive call, answer and hang up the call, observe that
      Gmail and Chrome are still paired.
Change-Id: I8ee6c078bd8a1816a96a9515b1a50e652de70d1c
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java
index c95c9f0..670beea 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java
@@ -29,6 +29,7 @@
 import static android.view.RemoteAnimationTarget.MODE_OPENING;
 import static android.view.WindowManager.LayoutParams.TYPE_DOCK_DIVIDER;
 import static android.view.WindowManager.TRANSIT_CHANGE;
+import static android.view.WindowManager.TRANSIT_CLOSE;
 import static android.view.WindowManager.TRANSIT_KEYGUARD_OCCLUDE;
 import static android.view.WindowManager.TRANSIT_TO_BACK;
 import static android.view.WindowManager.TRANSIT_TO_FRONT;
@@ -2580,7 +2581,7 @@
                                 + " with " + taskInfo.taskId + " before startAnimation().");
                         record.addRecord(stage, true, taskInfo.taskId);
                     }
-                } else if (isClosingType(change.getMode())) {
+                } else if (change.getMode() == TRANSIT_CLOSE) {
                     if (stage.containsTask(taskInfo.taskId)) {
                         record.addRecord(stage, false, taskInfo.taskId);
                         Log.w(TAG, "Expected onTaskVanished on " + stage + " to have been called"