summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-05-12 18:07:47 -0700
committerDianne Hackborn <hackbod@google.com>2011-05-12 18:39:51 -0700
commitebff8f92f13513ce37bd74759eb1db63f2220590 (patch)
tree909da02ab7ff47483e227f032828dbdbe7f959af /services
parenta8138732a01b92f0a40f72050b74a3bd4cf6d215 (diff)
downloadframeworks_base-ebff8f92f13513ce37bd74759eb1db63f2220590.zip
frameworks_base-ebff8f92f13513ce37bd74759eb1db63f2220590.tar.gz
frameworks_base-ebff8f92f13513ce37bd74759eb1db63f2220590.tar.bz2
DO NOT MERGE. Integrate add new screen width/height in "dp" configs.
You can now specify resource configuration variants "wNNNdp" and "hNNNdp". These are the minimum screen width/height in "dp" units. This allows you to do things like have your app adjust its layout based only on the about of horizontal space available. This introduces a new configuration change flag for screen size. Note that this configuration change happens each time the orientation changes. Applications often say they handle the orientation change to avoid being restarted at a screen rotation, and this will now cause them to be restarted. To address this, we assume the app can handle this new config change if its target SDK version is < ICS. Change-Id: I4acb73d82677b74092c1da9e4046a4951921f9f4
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/wm/WindowManagerService.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index 769e423..5fb0d81 100644
--- a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -5454,6 +5454,9 @@ public class WindowManagerService extends IWindowManager.Stub
mCompatibleScreenScale = CompatibilityInfo.updateCompatibleScreenFrame(
dm, mCompatibleScreenFrame, null);
+ config.screenWidthDp = (int)(dm.widthPixels / dm.density);
+ config.screenHeightDp = (int)(dm.heightPixels / dm.density);
+
if (mScreenLayout == Configuration.SCREENLAYOUT_SIZE_UNDEFINED) {
// Note we only do this once because at this point we don't
// expect the screen to change in this way at runtime, and want