OSDN Git Service

Ensure the IME container is never magnified.
authorRobert Carr <racarr@google.com>
Fri, 5 Jan 2018 02:27:42 +0000 (18:27 -0800)
committerRobert Carr <racarr@google.com>
Fri, 5 Jan 2018 02:30:49 +0000 (18:30 -0800)
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

services/core/java/com/android/server/wm/DisplayContent.java

index d053015..ed07358 100644 (file)
@@ -187,9 +187,10 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
             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 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
         }
     }
 
+    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);