summaryrefslogtreecommitdiffstats
path: root/core/java/android/content/res
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-06-03 15:01:49 -0700
committerDianne Hackborn <hackbod@google.com>2011-06-03 15:01:49 -0700
commitead40eaedb7993ca8c5153c349dd65f276d6862e (patch)
tree894b44e59956ac5f454fe9634a1b0379fccbdd22 /core/java/android/content/res
parente91a45a6cf8410771db07ffbdb52c6dfd0bf739d (diff)
parentcc20b4e31ece564800aa2322efe3ae9da163b570 (diff)
downloadframeworks_base-ead40eaedb7993ca8c5153c349dd65f276d6862e.zip
frameworks_base-ead40eaedb7993ca8c5153c349dd65f276d6862e.tar.gz
frameworks_base-ead40eaedb7993ca8c5153c349dd65f276d6862e.tar.bz2
resolved conflicts for merge of cc20b4e3 to master
Change-Id: I990368443a16a0577f7a1f5623b348cca3f81ac4
Diffstat (limited to 'core/java/android/content/res')
-rw-r--r--core/java/android/content/res/CompatibilityInfo.java31
1 files changed, 26 insertions, 5 deletions
diff --git a/core/java/android/content/res/CompatibilityInfo.java b/core/java/android/content/res/CompatibilityInfo.java
index 0d2e567..b686e54 100644
--- a/core/java/android/content/res/CompatibilityInfo.java
+++ b/core/java/android/content/res/CompatibilityInfo.java
@@ -96,21 +96,42 @@ public class CompatibilityInfo implements Parcelable {
boolean forceCompat) {
int compatFlags = 0;
- if (appInfo.requiresSmallestWidthDp != 0 || appInfo.compatibleWidthLimitDp != 0) {
+ if (appInfo.requiresSmallestWidthDp != 0 || appInfo.compatibleWidthLimitDp != 0
+ || appInfo.largestWidthLimitDp != 0) {
// New style screen requirements spec.
int required = appInfo.requiresSmallestWidthDp != 0
? appInfo.requiresSmallestWidthDp
: appInfo.compatibleWidthLimitDp;
+ if (required == 0) {
+ required = appInfo.largestWidthLimitDp;
+ }
int compat = appInfo.compatibleWidthLimitDp != 0
- ? appInfo.compatibleWidthLimitDp
- : appInfo.requiresSmallestWidthDp;
+ ? appInfo.compatibleWidthLimitDp : required;
if (compat < required) {
compat = required;
}
-
- if (compat >= sw) {
+ int largest = appInfo.largestWidthLimitDp;
+
+ if (required > DEFAULT_NORMAL_SHORT_DIMENSION) {
+ // For now -- if they require a size larger than the only
+ // size we can do in compatibility mode, then don't ever
+ // allow the app to go in to compat mode. Trying to run
+ // it at a smaller size it can handle will make it far more
+ // broken than running at a larger size than it wants or
+ // thinks it can handle.
+ compatFlags |= NEVER_NEEDS_COMPAT;
+ } else if (largest != 0 && sw > largest) {
+ // If the screen size is larger than the largest size the
+ // app thinks it can work with, then always force it in to
+ // compatibility mode.
+ compatFlags |= NEEDS_SCREEN_COMPAT | ALWAYS_NEEDS_COMPAT;
+ } else if (compat >= sw) {
+ // The screen size is something the app says it was designed
+ // for, so never do compatibility mode.
compatFlags |= NEVER_NEEDS_COMPAT;
} else if (forceCompat) {
+ // The app may work better with or without compatibility mode.
+ // Let the user decide.
compatFlags |= NEEDS_SCREEN_COMPAT;
}