From b63928a256f5d578979479efb6727dcb87a86d87 Mon Sep 17 00:00:00 2001 From: Jacky Kao Date: Thu, 10 Mar 2022 10:20:59 +0800 Subject: [PATCH] Fixs the window bounds not correct after rotation When the device is rotated and the window is magnifying, we need to apply the displayInfo matrix from the SF's callback to obtain the window bounds based on the rotated-coordination and the inverse matrix from the magnification spec to obtain the un-magnified window bounds. The order of applying the displayInfo matrix and inverse matrix should be the former first and then the latter, and we can get the correct window bounds. Bug: 223687400 Test: a11y CTS & unit tests Test: Manual testing including the A11y services Change-Id: I72d14170b1ecd88c8b28ba7433dc8bee8626dfa0 --- .../com/android/server/wm/AccessibilityWindowsPopulator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/AccessibilityWindowsPopulator.java b/services/core/java/com/android/server/wm/AccessibilityWindowsPopulator.java index d4648a4f313c9..f594e2823d91a 100644 --- a/services/core/java/com/android/server/wm/AccessibilityWindowsPopulator.java +++ b/services/core/java/com/android/server/wm/AccessibilityWindowsPopulator.java @@ -810,8 +810,8 @@ public final class AccessibilityWindowsPopulator extends WindowInfosListener { RectF windowFrame = TEMP_RECTF; windowFrame.set(rect); - inverseMatrix.mapRect(windowFrame); displayMatrix.mapRect(windowFrame); + inverseMatrix.mapRect(windowFrame); // Union all rects. outRegion.union(new Rect((int) windowFrame.left, (int) windowFrame.top, (int) windowFrame.right, (int) windowFrame.bottom));