summaryrefslogtreecommitdiffstats
path: root/services/java
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-07-21 19:03:53 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2009-07-21 19:03:53 -0700
commita8339dfec9d1b2c6d6fd2f8268f8075d184f64c0 (patch)
tree40345158a2aa1084b21de121e5eb8b0d8f8f36a3 /services/java
parent9822d2b27330793ea4ba9c3316ef35f402f35fb4 (diff)
parent9fc20b0e381b5fe00b7049ef357c839cd05a33bf (diff)
downloadframeworks_base-a8339dfec9d1b2c6d6fd2f8268f8075d184f64c0.zip
frameworks_base-a8339dfec9d1b2c6d6fd2f8268f8075d184f64c0.tar.gz
frameworks_base-a8339dfec9d1b2c6d6fd2f8268f8075d184f64c0.tar.bz2
am 9fc20b0e: Merge change 8126 into donut
Merge commit '9fc20b0e381b5fe00b7049ef357c839cd05a33bf' * commit '9fc20b0e381b5fe00b7049ef357c839cd05a33bf': First pass at reworking screen density/size APIs.
Diffstat (limited to 'services/java')
-rw-r--r--services/java/com/android/server/PackageManagerService.java4
-rw-r--r--services/java/com/android/server/WindowManagerService.java37
2 files changed, 32 insertions, 9 deletions
diff --git a/services/java/com/android/server/PackageManagerService.java b/services/java/com/android/server/PackageManagerService.java
index 9de4150..9c60157 100644
--- a/services/java/com/android/server/PackageManagerService.java
+++ b/services/java/com/android/server/PackageManagerService.java
@@ -4919,6 +4919,10 @@ class PackageManagerService extends IPackageManager.Stub {
ApplicationInfo.FLAG_SUPPORTS_SMALL_SCREENS) != 0) {
screens.add("small,");
}
+ if ((ps.pkg.applicationInfo.flags &
+ ApplicationInfo.FLAG_RESIZEABLE_FOR_SCREENS) != 0) {
+ screens.add("resizeable,");
+ }
pw.print(" supportsScreens="); pw.println(screens);
}
pw.print(" timeStamp="); pw.println(ps.getTimeStampStr());
diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java
index 4bc7c68..b43acaf 100644
--- a/services/java/com/android/server/WindowManagerService.java
+++ b/services/java/com/android/server/WindowManagerService.java
@@ -423,7 +423,7 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo
final Rect mTempRect = new Rect();
final Configuration mTempConfiguration = new Configuration();
- int screenLayout = Configuration.SCREENLAYOUT_UNDEFINED;
+ int mScreenLayout = Configuration.SCREENLAYOUT_SIZE_UNDEFINED;
// The frame use to limit the size of the app running in compatibility mode.
Rect mCompatibleScreenFrame = new Rect();
@@ -3766,7 +3766,7 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo
mDisplay.getMetrics(dm);
CompatibilityInfo.updateCompatibleScreenFrame(dm, orientation, mCompatibleScreenFrame);
- if (screenLayout == Configuration.SCREENLAYOUT_UNDEFINED) {
+ 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
// to avoid all of this computation for every config change.
@@ -3786,16 +3786,35 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo
if (longSize < 470) {
// This is shorter than an HVGA normal density screen (which
// is 480 pixels on its long side).
- screenLayout = Configuration.SCREENLAYOUT_SMALL;
- } else if (longSize > 490 && shortSize > 330) {
- // This is larger than an HVGA normal density screen (which
- // is 480x320 pixels).
- screenLayout = Configuration.SCREENLAYOUT_LARGE;
+ mScreenLayout = Configuration.SCREENLAYOUT_SIZE_SMALL
+ | Configuration.SCREENLAYOUT_LONG_NO;
} else {
- screenLayout = Configuration.SCREENLAYOUT_NORMAL;
+ // Is this a large screen?
+ if (longSize > 640 && shortSize >= 480) {
+ // VGA or larger screens at medium density are the point
+ // at which we consider it to be a large screen.
+ mScreenLayout = Configuration.SCREENLAYOUT_SIZE_LARGE;
+ } else {
+ mScreenLayout = Configuration.SCREENLAYOUT_SIZE_NORMAL;
+
+ // If this screen is wider than normal HVGA, or taller
+ // than FWVGA, then for old apps we want to run in size
+ // compatibility mode.
+ if (shortSize > 321 || longSize > 570) {
+ mScreenLayout |= Configuration.SCREENLAYOUT_COMPAT_NEEDED;
+ }
+ }
+
+ // Is this a long screen?
+ if (((longSize*3)/5) >= (shortSize-1)) {
+ // Anything wider than WVGA (5:3) is considering to be long.
+ mScreenLayout |= Configuration.SCREENLAYOUT_LONG_YES;
+ } else {
+ mScreenLayout |= Configuration.SCREENLAYOUT_LONG_NO;
+ }
}
}
- config.screenLayout = screenLayout;
+ config.screenLayout = mScreenLayout;
config.keyboardHidden = Configuration.KEYBOARDHIDDEN_NO;
config.hardKeyboardHidden = Configuration.HARDKEYBOARDHIDDEN_NO;