diff --git a/api/current.xml b/api/current.xml index 0e2aaf1d18cd4..ae816383dfc84 100644 --- a/api/current.xml +++ b/api/current.xml @@ -3128,6 +3128,17 @@ visibility="public" > + + + + + + + + - + + + + + - + + + + + + + diff --git a/services/java/com/android/server/am/CompatModePackages.java b/services/java/com/android/server/am/CompatModePackages.java index 1277bca5ed518..221b59b8307a3 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> it = pkgs.entrySet().iterator(); while (it.hasNext()) { Map.Entry 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; } diff --git a/tests/DpiTest/src/com/google/android/test/dpi/DpiTestActivity.java b/tests/DpiTest/src/com/google/android/test/dpi/DpiTestActivity.java index 2a40c570a5f69..01c1c70f3f2af 100644 --- a/tests/DpiTest/src/com/google/android/test/dpi/DpiTestActivity.java +++ b/tests/DpiTest/src/com/google/android/test/dpi/DpiTestActivity.java @@ -63,7 +63,8 @@ public class DpiTestActivity extends Activity { | ApplicationInfo.FLAG_RESIZEABLE_FOR_SCREENS | ApplicationInfo.FLAG_SUPPORTS_SCREEN_DENSITIES; app.getResources().setCompatibilityInfo(new CompatibilityInfo(ai, - getResources().getConfiguration().screenLayout, false)); + getResources().getConfiguration().screenLayout, + getResources().getConfiguration().smallestScreenWidthDp, false)); } } catch (PackageManager.NameNotFoundException e) { throw new RuntimeException("ouch", e);