diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 99a0e9032addf..c56a22ef2bbea 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -1842,7 +1842,7 @@ public class WindowManagerService extends IWindowManager.Stub // Make this invalid which indicates a null attached frame. outAttachedFrame.set(0, 0, -1, -1); } - outSizeCompatScale[0] = win.getSizeCompatScale(); + outSizeCompatScale[0] = win.getSizeCompatScaleForClient(); } Binder.restoreCallingIdentity(origId); diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index f06a8c9ffe820..17e64995fe8c6 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -1267,8 +1267,10 @@ class WindowState extends WindowContainer implements WindowManagerP mGlobalScale = mInvGlobalScale = mSizeCompatScale = 1f; } - float getSizeCompatScale() { - return mSizeCompatScale; + float getSizeCompatScaleForClient() { + // If the size compat scale is because of the size compat bounds, we only scale down its + // coordinates at the server side without letting the client know. + return mToken.hasSizeCompatBounds() ? 1f : mSizeCompatScale; } /** @@ -3865,7 +3867,8 @@ class WindowState extends WindowContainer implements WindowManagerP outFrames.attachedFrame.scale(mInvGlobalScale); } } - outFrames.sizeCompatScale = mSizeCompatScale; + + outFrames.sizeCompatScale = getSizeCompatScaleForClient(); // Note: in the cases where the window is tied to an activity, we should not send a // configuration update when the window has requested to be hidden. Doing so can lead to