Do not return stacks to AM that are marked for deferred removal.

When the Activity Manager informs the Window Manager that a stack has
been removed, it can opt to hold onto the stack (such as when an
animation is in progress). This can lead to inconsistencies where the
Window Manager can report a stack back to the Activity Manager that
has since been removed.

This changelist addresses one such call point in
WindowManagerService#setNewDisplayOverrideConfiguration. Deferred
removed displays are now filtered out of the returned list.

Change-Id: I5f7aad9296cec8bd56e933a71553f9cd40579378
Fixes: 71548119
Test: atest FrameworksServicesTests:com.android.server.wm.RootWindowContainerTests
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java
index 7674b5e..651908b 100644
--- a/services/core/java/com/android/server/wm/DisplayContent.java
+++ b/services/core/java/com/android/server/wm/DisplayContent.java
@@ -1542,11 +1542,11 @@
      * Callback used to trigger bounds update after configuration change and get ids of stacks whose
      * bounds were updated.
      */
-    void updateStackBoundsAfterConfigChange(@NonNull List<Integer> changedStackList) {
+    void updateStackBoundsAfterConfigChange(@NonNull List<TaskStack> changedStackList) {
         for (int i = mTaskStackContainers.getChildCount() - 1; i >= 0; --i) {
             final TaskStack stack = mTaskStackContainers.getChildAt(i);
             if (stack.updateBoundsAfterConfigChange()) {
-                changedStackList.add(stack.mStackId);
+                changedStackList.add(stack);
             }
         }