diff options
author | Dianne Hackborn <hackbod@google.com> | 2011-05-19 18:13:32 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2011-05-19 18:23:29 -0700 |
commit | 69cb87576ba163b61bb0e6477a3b7c57a9b11d40 (patch) | |
tree | a44be0af3d008409403be133358bdcd628741c01 /services | |
parent | b9537db8d9ee27efb4a98415ad2d6b50c1806e5d (diff) | |
download | frameworks_base-69cb87576ba163b61bb0e6477a3b7c57a9b11d40.zip frameworks_base-69cb87576ba163b61bb0e6477a3b7c57a9b11d40.tar.gz frameworks_base-69cb87576ba163b61bb0e6477a3b7c57a9b11d40.tar.bz2 |
Add new "-swNNNdp" resource qualifier.
Change-Id: I0101e88ca9d8d44138bdcaf571f24b0352f4f6ce
Diffstat (limited to 'services')
-rw-r--r-- | services/java/com/android/server/wm/WindowManagerService.java | 50 |
1 files changed, 39 insertions, 11 deletions
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java index 607c60a..5c49ef09 100644 --- a/services/java/com/android/server/wm/WindowManagerService.java +++ b/services/java/com/android/server/wm/WindowManagerService.java @@ -4779,8 +4779,8 @@ public class WindowManagerService extends IWindowManager.Stub synchronized(mWindowMap) { long ident = Binder.clearCallingIdentity(); - dw = mPolicy.getNonDecorDisplayWidth(mCurDisplayWidth); - dh = mPolicy.getNonDecorDisplayHeight(mCurDisplayHeight); + dw = mPolicy.getNonDecorDisplayWidth(mRotation, mCurDisplayWidth); + dh = mPolicy.getNonDecorDisplayHeight(mRotation, mCurDisplayHeight); int aboveAppLayer = mPolicy.windowTypeToLayerLw( WindowManager.LayoutParams.TYPE_APPLICATION) * TYPE_LAYER_MULTIPLIER @@ -5497,6 +5497,14 @@ public class WindowManagerService extends IWindowManager.Stub return config; } + private int reduceConfigWidthSize(int curSize, int rotation, float density, int dw) { + int size = (int)(mPolicy.getConfigDisplayWidth(rotation, dw) / density); + if (size < curSize) { + curSize = size; + } + return curSize; + } + boolean computeNewConfigurationLocked(Configuration config) { if (mDisplay == null) { return false; @@ -5547,14 +5555,37 @@ 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.realWidthPixels = mPolicy.getNonDecorDisplayWidth(dw); - dm.heightPixels = dm.realHeightPixels = mPolicy.getNonDecorDisplayHeight(dh); + dm.widthPixels = dm.realWidthPixels = mPolicy.getNonDecorDisplayWidth( + mRotation, dw); + dm.heightPixels = dm.realHeightPixels = mPolicy.getNonDecorDisplayHeight( + mRotation, dh); mCompatibleScreenScale = CompatibilityInfo.updateCompatibleScreenFrame( dm, mCompatibleScreenFrame, null); - config.screenWidthDp = (int)(dm.widthPixels / dm.density); - config.screenHeightDp = (int)(dm.heightPixels / dm.density); + config.screenWidthDp = (int)(mPolicy.getConfigDisplayWidth(mRotation, dw) / dm.density); + config.screenHeightDp = (int)(mPolicy.getConfigDisplayHeight(mRotation, dh) / dm.density); + + // We need to determine the smallest width that will occur under normal + // operation. To this, start with the base screen size and compute the + // width under the different possible rotations. We need to un-rotate + // the current screen dimensions before doing this. + int unrotDw, unrotDh; + if (rotated) { + unrotDw = dh; + unrotDh = dw; + } else { + unrotDw = dw; + unrotDh = dh; + } + config.smallestScreenWidthDp = reduceConfigWidthSize(unrotDw, + Surface.ROTATION_0, dm.density, unrotDw); + config.smallestScreenWidthDp = reduceConfigWidthSize(config.smallestScreenWidthDp, + Surface.ROTATION_90, dm.density, unrotDh); + config.smallestScreenWidthDp = reduceConfigWidthSize(config.smallestScreenWidthDp, + Surface.ROTATION_180, dm.density, unrotDw); + config.smallestScreenWidthDp = reduceConfigWidthSize(config.smallestScreenWidthDp, + Surface.ROTATION_270, dm.density, unrotDh); // Compute the screen layout size class. int screenLayout; @@ -6806,9 +6837,6 @@ public class WindowManagerService extends IWindowManager.Stub final int dw = mCurDisplayWidth; final int dh = mCurDisplayHeight; - final int innerDw = mPolicy.getNonDecorDisplayWidth(dw); - final int innerDh = mPolicy.getNonDecorDisplayHeight(dh); - final int N = mWindows.size(); int i; @@ -6929,8 +6957,8 @@ public class WindowManagerService extends IWindowManager.Stub final int dw = mCurDisplayWidth; final int dh = mCurDisplayHeight; - final int innerDw = mPolicy.getNonDecorDisplayWidth(dw); - final int innerDh = mPolicy.getNonDecorDisplayHeight(dh); + final int innerDw = mPolicy.getNonDecorDisplayWidth(mRotation, dw); + final int innerDh = mPolicy.getNonDecorDisplayHeight(mRotation, dh); int i; |