diff options
| author | Dianne Hackborn <hackbod@google.com> | 2011-05-26 14:20:23 -0700 |
|---|---|---|
| committer | Dianne Hackborn <hackbod@google.com> | 2011-05-26 14:48:04 -0700 |
| commit | df6e980e3f63eb0f6f9eb437fa925d5009cd9c44 (patch) | |
| tree | 5440eeb979427cf2d0be09e067b0dd5c0d62a943 /services/java | |
| parent | 7a09f72b8850ec22e4ca7fd50aba20ead7666f67 (diff) | |
| download | frameworks_base-df6e980e3f63eb0f6f9eb437fa925d5009cd9c44.zip frameworks_base-df6e980e3f63eb0f6f9eb437fa925d5009cd9c44.tar.gz frameworks_base-df6e980e3f63eb0f6f9eb437fa925d5009cd9c44.tar.bz2 | |
Add new supports-screens attributes for declaring the compatible screens.
Change-Id: I40d57e4354e48accc1027c9f90916ea73eb5190d
android:requiresSmallestWidthDp provides the smallest supported width.
android:compatibleWidthLimitDp provides the largest compatible width.
Diffstat (limited to 'services/java')
| -rw-r--r-- | services/java/com/android/server/am/CompatModePackages.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/services/java/com/android/server/am/CompatModePackages.java b/services/java/com/android/server/am/CompatModePackages.java index 1277bca..221b59b 100644 --- a/services/java/com/android/server/am/CompatModePackages.java +++ b/services/java/com/android/server/am/CompatModePackages.java @@ -119,13 +119,15 @@ public class CompatModePackages { public CompatibilityInfo compatibilityInfoForPackageLocked(ApplicationInfo ai) { return new CompatibilityInfo(ai, mService.mConfiguration.screenLayout, + mService.mConfiguration.smallestScreenWidthDp, (getPackageFlags(ai.packageName)&COMPAT_FLAG_ENABLED) != 0); } public int computeCompatModeLocked(ApplicationInfo ai) { boolean enabled = (getPackageFlags(ai.packageName)&COMPAT_FLAG_ENABLED) != 0; CompatibilityInfo info = new CompatibilityInfo(ai, - mService.mConfiguration.screenLayout, enabled); + mService.mConfiguration.screenLayout, + mService.mConfiguration.smallestScreenWidthDp, enabled); if (info.alwaysSupportsScreen()) { return ActivityManager.COMPAT_MODE_NEVER; } @@ -315,6 +317,7 @@ public class CompatModePackages { final IPackageManager pm = AppGlobals.getPackageManager(); final int screenLayout = mService.mConfiguration.screenLayout; + final int smallestScreenWidthDp = mService.mConfiguration.smallestScreenWidthDp; final Iterator<Map.Entry<String, Integer>> it = pkgs.entrySet().iterator(); while (it.hasNext()) { Map.Entry<String, Integer> entry = it.next(); @@ -331,7 +334,8 @@ public class CompatModePackages { if (ai == null) { continue; } - CompatibilityInfo info = new CompatibilityInfo(ai, screenLayout, false); + CompatibilityInfo info = new CompatibilityInfo(ai, screenLayout, + smallestScreenWidthDp, false); if (info.alwaysSupportsScreen()) { continue; } |
