From 83e0bc18e03868295f8358d875f2b67cb78f16a8 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Thu, 23 Jun 2011 11:58:50 -0700 Subject: DO NOT MERGE. Fix density compat mode. Fix issue #4770360: older app compatibility mode is really tiny on ICS phones We were applying the density compat mode scaling multiple times to display metrics, causing bad values. Change-Id: Iafafd9a5e94b9d774cd2715bf968e91602a1bd82 --- services/java/com/android/server/wm/WindowManagerService.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'services') diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java index c40c7fc..f7fd8f4 100644 --- a/services/java/com/android/server/wm/WindowManagerService.java +++ b/services/java/com/android/server/wm/WindowManagerService.java @@ -5552,10 +5552,10 @@ public class WindowManagerService extends IWindowManager.Stub private int reduceCompatConfigWidthSize(int curSize, int rotation, DisplayMetrics dm, int dw, int dh) { - dm.unscaledWidthPixels = mPolicy.getNonDecorDisplayWidth(rotation, dw); - dm.unscaledHeightPixels = mPolicy.getNonDecorDisplayHeight(rotation, dh); + dm.noncompatWidthPixels = mPolicy.getNonDecorDisplayWidth(rotation, dw); + dm.noncompatHeightPixels = mPolicy.getNonDecorDisplayHeight(rotation, dh); float scale = CompatibilityInfo.computeCompatibleScaling(dm, null); - int size = (int)(((dm.unscaledWidthPixels / scale) / dm.density) + .5f); + int size = (int)(((dm.noncompatWidthPixels / scale) / dm.density) + .5f); if (curSize == 0 || size < curSize) { curSize = size; } @@ -5630,9 +5630,9 @@ public class WindowManagerService extends IWindowManager.Stub // Override display width and height with what we are computing, // to be sure they remain consistent. - dm.widthPixels = dm.unscaledWidthPixels = mAppDisplayWidth + dm.widthPixels = dm.noncompatWidthPixels = mAppDisplayWidth = mPolicy.getNonDecorDisplayWidth(mRotation, dw); - dm.heightPixels = dm.unscaledHeightPixels = mAppDisplayHeight + dm.heightPixels = dm.noncompatHeightPixels = mAppDisplayHeight = mPolicy.getNonDecorDisplayHeight(mRotation, dh); mCompatibleScreenScale = CompatibilityInfo.computeCompatibleScaling(dm, -- cgit v1.1