Ensure the IME container is never magnified.

The existing logic works based on the window types inside
containers but if we magnify the IME container before the
IME window is ever added then things can get out of whack.

Bug: 70640763
Test: Manual
Change-Id: Icb937c2e1c37a77190eed1c6248277036b7c0e6d
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java
index d053015..ed07358 100644
--- a/services/core/java/com/android/server/wm/DisplayContent.java
+++ b/services/core/java/com/android/server/wm/DisplayContent.java
@@ -187,9 +187,10 @@
             new NonAppWindowContainers("mBelowAppWindowsContainers", mService);
     // Contains all IME window containers. Note that the z-ordering of the IME windows will depend
     // on the IME target. We mainly have this container grouping so we can keep track of all the IME
-    // window containers together and move them in-sync if/when needed.
-    private final NonAppWindowContainers mImeWindowsContainers =
-            new NonAppWindowContainers("mImeWindowsContainers", mService);
+    // window containers together and move them in-sync if/when needed. We use a subclass of
+    // WindowContainer which is omitted from screen magnification, as the IME is never magnified.
+    private final NonMagnifiableWindowContainers mImeWindowsContainers =
+            new NonMagnifiableWindowContainers("mImeWindowsContainers", mService);
 
     private WindowState mTmpWindow;
     private WindowState mTmpWindow2;
@@ -3649,6 +3650,16 @@
         }
     }
 
+    private class NonMagnifiableWindowContainers extends NonAppWindowContainers {
+        NonMagnifiableWindowContainers(String name, WindowManagerService service) {
+            super(name, service);
+        }
+
+        @Override
+        void applyMagnificationSpec(Transaction t, MagnificationSpec spec) {
+        }
+    };
+
     SurfaceControl.Builder makeSurface(SurfaceSession s) {
         return mService.makeSurfaceBuilder(s)
                 .setParent(mWindowingLayer);