From 30869024f9729347ec73e2f915bc34b5a13aebb0 Mon Sep 17 00:00:00 2001 From: Riddle Hsu Date: Fri, 12 Feb 2021 20:07:43 +0800 Subject: [PATCH] Fix NPE in getCompatibleMagnificationSpecForWindow The commit 179a6b0 forgot to change the returned result. Note that if the "spec" is non-null, the old code will cause the source spec of DisplayMagnifier to be cumulatively multiplied and then become infinite scale. Bug: 180050756 Test: Enable compat scale and TalkBack Change-Id: I5a647d4129165021054631461fb97aef61def390 --- .../core/java/com/android/server/wm/WindowManagerService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 3c7bab3da2794..2d5fdcea17982 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -7531,8 +7531,8 @@ public class WindowManagerService extends IWindowManager.Stub if (spec != null) { result.setTo(spec); } - spec.scale *= windowState.mGlobalScale; - return spec; + result.scale *= windowState.mGlobalScale; + return result; } }