summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-05-19 19:30:32 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-05-19 19:30:32 -0700
commitc851ea5672f6e042c2e89b2a2ce4a2467e1fcd2a (patch)
treec349206e8773ecdeb4cae8b537982b78e1c9d589 /services
parentd40575eb983eb7a1d383acc1f30f467374acd085 (diff)
parent69cb87576ba163b61bb0e6477a3b7c57a9b11d40 (diff)
downloadframeworks_base-c851ea5672f6e042c2e89b2a2ce4a2467e1fcd2a.zip
frameworks_base-c851ea5672f6e042c2e89b2a2ce4a2467e1fcd2a.tar.gz
frameworks_base-c851ea5672f6e042c2e89b2a2ce4a2467e1fcd2a.tar.bz2
am 69cb8757: Add new "-swNNNdp" resource qualifier.
* commit '69cb87576ba163b61bb0e6477a3b7c57a9b11d40': Add new "-swNNNdp" resource qualifier.
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/wm/WindowManagerService.java50
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;