Loading api/current.xml +43 −1 Original line number Diff line number Diff line Loading @@ -3128,6 +3128,17 @@ visibility="public" > </field> <field name="compatibleWidthLimitDp" type="int" transient="false" volatile="false" value="16843621" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="completionHint" type="int" transient="false" Loading Loading @@ -7913,6 +7924,17 @@ visibility="public" > </field> <field name="requiresSmallestWidthDp" type="int" transient="false" volatile="false" value="16843620" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="resizeMode" type="int" transient="false" Loading Loading @@ -58670,6 +58692,16 @@ visibility="public" > </field> <field name="compatibleWidthLimitDp" type="int" transient="false" volatile="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </field> <field name="dataDir" type="java.lang.String" transient="false" Loading Loading @@ -58760,6 +58792,16 @@ visibility="public" > </field> <field name="requiresSmallestWidthDp" type="int" transient="false" volatile="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </field> <field name="sharedLibraryFiles" type="java.lang.String[]" transient="false" Loading Loading @@ -221191,7 +221233,7 @@ deprecated="not deprecated" visibility="public" > <parameter name="ev" type="android.view.MotionEvent"> <parameter name="event" type="android.view.MotionEvent"> </parameter> </method> <method name="clear" core/java/android/app/ActivityThread.java +1 −1 Original line number Diff line number Diff line Loading @@ -1525,7 +1525,7 @@ public final class ActivityThread { synchronized (this) { ContextImpl context = getSystemContext(); context.init(new LoadedApk(this, "android", context, info, new CompatibilityInfo(info, 0, false)), null, this); new CompatibilityInfo(info, 0, 0, false)), null, this); } } Loading core/java/android/content/pm/ApplicationInfo.java +24 −0 Original line number Diff line number Diff line Loading @@ -320,6 +320,22 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { */ public int flags = 0; /** * The required smallest screen width the application can run on. If 0, * nothing has been specified. Comes from * {@link android.R.styleable#AndroidManifestSupportsScreens_requiresSmallestWidthDp * android:requiresSmallestWidthDp} attribute of the <supports-screens> tag. */ public int requiresSmallestWidthDp = 0; /** * The maximum smallest screen width the application is designed for. If 0, * nothing has been specified. Comes from * {@link android.R.styleable#AndroidManifestSupportsScreens_compatibleWidthLimitDp * android:compatibleWidthLimitDp} attribute of the <supports-screens> tag. */ public int compatibleWidthLimitDp = 0; /** * Full path to the location of this package. */ Loading Loading @@ -401,6 +417,8 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { pw.println(prefix + "taskAffinity=" + taskAffinity); pw.println(prefix + "uid=" + uid + " flags=0x" + Integer.toHexString(flags) + " theme=0x" + Integer.toHexString(theme)); pw.println(prefix + "requiresSmallestWidthDp=" + requiresSmallestWidthDp + " compatibleWidthLimitDp=" + compatibleWidthLimitDp); pw.println(prefix + "sourceDir=" + sourceDir); if (sourceDir == null) { if (publicSourceDir != null) { Loading Loading @@ -460,6 +478,8 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { className = orig.className; theme = orig.theme; flags = orig.flags; requiresSmallestWidthDp = orig.requiresSmallestWidthDp; compatibleWidthLimitDp = orig.compatibleWidthLimitDp; sourceDir = orig.sourceDir; publicSourceDir = orig.publicSourceDir; nativeLibraryDir = orig.nativeLibraryDir; Loading Loading @@ -493,6 +513,8 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { dest.writeString(className); dest.writeInt(theme); dest.writeInt(flags); dest.writeInt(requiresSmallestWidthDp); dest.writeInt(compatibleWidthLimitDp); dest.writeString(sourceDir); dest.writeString(publicSourceDir); dest.writeString(nativeLibraryDir); Loading Loading @@ -526,6 +548,8 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { className = source.readString(); theme = source.readInt(); flags = source.readInt(); requiresSmallestWidthDp = source.readInt(); compatibleWidthLimitDp = source.readInt(); sourceDir = source.readString(); publicSourceDir = source.readString(); nativeLibraryDir = source.readString(); Loading core/java/android/content/pm/PackageParser.java +7 −0 Original line number Diff line number Diff line Loading @@ -993,6 +993,13 @@ public class PackageParser { sa = res.obtainAttributes(attrs, com.android.internal.R.styleable.AndroidManifestSupportsScreens); pkg.applicationInfo.requiresSmallestWidthDp = sa.getInteger( com.android.internal.R.styleable.AndroidManifestSupportsScreens_requiresSmallestWidthDp, 0); pkg.applicationInfo.compatibleWidthLimitDp = sa.getInteger( com.android.internal.R.styleable.AndroidManifestSupportsScreens_compatibleWidthLimitDp, 0); // This is a trick to get a boolean and still able to detect // if a value was actually set. supportsSmallScreens = sa.getInteger( Loading core/java/android/content/res/CompatibilityInfo.java +93 −67 Original line number Diff line number Diff line Loading @@ -110,9 +110,34 @@ public class CompatibilityInfo implements Parcelable { */ public final float applicationInvertedScale; public CompatibilityInfo(ApplicationInfo appInfo, int screenLayout, boolean forceCompat) { public CompatibilityInfo(ApplicationInfo appInfo, int screenLayout, int sw, boolean forceCompat) { int compatFlags = 0; if (appInfo.requiresSmallestWidthDp != 0 || appInfo.compatibleWidthLimitDp != 0) { // New style screen requirements spec. int required = appInfo.requiresSmallestWidthDp != 0 ? appInfo.requiresSmallestWidthDp : appInfo.compatibleWidthLimitDp; int compat = appInfo.compatibleWidthLimitDp != 0 ? appInfo.compatibleWidthLimitDp : appInfo.requiresSmallestWidthDp; if (compat < required) { compat = required; } if (compat >= sw) { compatFlags |= NEVER_COMPAT; } else if (forceCompat) { compatFlags |= NEEDS_SCREEN_COMPAT; } // Modern apps always support densities. applicationDensity = DisplayMetrics.DENSITY_DEVICE; applicationScale = 1.0f; applicationInvertedScale = 1.0f; } else { // We can't rely on the application always setting // FLAG_RESIZEABLE_FOR_SCREENS so will compute it based on various input. boolean anyResizeable = false; Loading Loading @@ -191,6 +216,7 @@ public class CompatibilityInfo implements Parcelable { applicationInvertedScale = 1.0f / applicationScale; compatFlags |= SCALING_REQUIRED; } } mCompatibilityFlags = compatFlags; } Loading Loading
api/current.xml +43 −1 Original line number Diff line number Diff line Loading @@ -3128,6 +3128,17 @@ visibility="public" > </field> <field name="compatibleWidthLimitDp" type="int" transient="false" volatile="false" value="16843621" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="completionHint" type="int" transient="false" Loading Loading @@ -7913,6 +7924,17 @@ visibility="public" > </field> <field name="requiresSmallestWidthDp" type="int" transient="false" volatile="false" value="16843620" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="resizeMode" type="int" transient="false" Loading Loading @@ -58670,6 +58692,16 @@ visibility="public" > </field> <field name="compatibleWidthLimitDp" type="int" transient="false" volatile="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </field> <field name="dataDir" type="java.lang.String" transient="false" Loading Loading @@ -58760,6 +58792,16 @@ visibility="public" > </field> <field name="requiresSmallestWidthDp" type="int" transient="false" volatile="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </field> <field name="sharedLibraryFiles" type="java.lang.String[]" transient="false" Loading Loading @@ -221191,7 +221233,7 @@ deprecated="not deprecated" visibility="public" > <parameter name="ev" type="android.view.MotionEvent"> <parameter name="event" type="android.view.MotionEvent"> </parameter> </method> <method name="clear"
core/java/android/app/ActivityThread.java +1 −1 Original line number Diff line number Diff line Loading @@ -1525,7 +1525,7 @@ public final class ActivityThread { synchronized (this) { ContextImpl context = getSystemContext(); context.init(new LoadedApk(this, "android", context, info, new CompatibilityInfo(info, 0, false)), null, this); new CompatibilityInfo(info, 0, 0, false)), null, this); } } Loading
core/java/android/content/pm/ApplicationInfo.java +24 −0 Original line number Diff line number Diff line Loading @@ -320,6 +320,22 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { */ public int flags = 0; /** * The required smallest screen width the application can run on. If 0, * nothing has been specified. Comes from * {@link android.R.styleable#AndroidManifestSupportsScreens_requiresSmallestWidthDp * android:requiresSmallestWidthDp} attribute of the <supports-screens> tag. */ public int requiresSmallestWidthDp = 0; /** * The maximum smallest screen width the application is designed for. If 0, * nothing has been specified. Comes from * {@link android.R.styleable#AndroidManifestSupportsScreens_compatibleWidthLimitDp * android:compatibleWidthLimitDp} attribute of the <supports-screens> tag. */ public int compatibleWidthLimitDp = 0; /** * Full path to the location of this package. */ Loading Loading @@ -401,6 +417,8 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { pw.println(prefix + "taskAffinity=" + taskAffinity); pw.println(prefix + "uid=" + uid + " flags=0x" + Integer.toHexString(flags) + " theme=0x" + Integer.toHexString(theme)); pw.println(prefix + "requiresSmallestWidthDp=" + requiresSmallestWidthDp + " compatibleWidthLimitDp=" + compatibleWidthLimitDp); pw.println(prefix + "sourceDir=" + sourceDir); if (sourceDir == null) { if (publicSourceDir != null) { Loading Loading @@ -460,6 +478,8 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { className = orig.className; theme = orig.theme; flags = orig.flags; requiresSmallestWidthDp = orig.requiresSmallestWidthDp; compatibleWidthLimitDp = orig.compatibleWidthLimitDp; sourceDir = orig.sourceDir; publicSourceDir = orig.publicSourceDir; nativeLibraryDir = orig.nativeLibraryDir; Loading Loading @@ -493,6 +513,8 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { dest.writeString(className); dest.writeInt(theme); dest.writeInt(flags); dest.writeInt(requiresSmallestWidthDp); dest.writeInt(compatibleWidthLimitDp); dest.writeString(sourceDir); dest.writeString(publicSourceDir); dest.writeString(nativeLibraryDir); Loading Loading @@ -526,6 +548,8 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { className = source.readString(); theme = source.readInt(); flags = source.readInt(); requiresSmallestWidthDp = source.readInt(); compatibleWidthLimitDp = source.readInt(); sourceDir = source.readString(); publicSourceDir = source.readString(); nativeLibraryDir = source.readString(); Loading
core/java/android/content/pm/PackageParser.java +7 −0 Original line number Diff line number Diff line Loading @@ -993,6 +993,13 @@ public class PackageParser { sa = res.obtainAttributes(attrs, com.android.internal.R.styleable.AndroidManifestSupportsScreens); pkg.applicationInfo.requiresSmallestWidthDp = sa.getInteger( com.android.internal.R.styleable.AndroidManifestSupportsScreens_requiresSmallestWidthDp, 0); pkg.applicationInfo.compatibleWidthLimitDp = sa.getInteger( com.android.internal.R.styleable.AndroidManifestSupportsScreens_compatibleWidthLimitDp, 0); // This is a trick to get a boolean and still able to detect // if a value was actually set. supportsSmallScreens = sa.getInteger( Loading
core/java/android/content/res/CompatibilityInfo.java +93 −67 Original line number Diff line number Diff line Loading @@ -110,9 +110,34 @@ public class CompatibilityInfo implements Parcelable { */ public final float applicationInvertedScale; public CompatibilityInfo(ApplicationInfo appInfo, int screenLayout, boolean forceCompat) { public CompatibilityInfo(ApplicationInfo appInfo, int screenLayout, int sw, boolean forceCompat) { int compatFlags = 0; if (appInfo.requiresSmallestWidthDp != 0 || appInfo.compatibleWidthLimitDp != 0) { // New style screen requirements spec. int required = appInfo.requiresSmallestWidthDp != 0 ? appInfo.requiresSmallestWidthDp : appInfo.compatibleWidthLimitDp; int compat = appInfo.compatibleWidthLimitDp != 0 ? appInfo.compatibleWidthLimitDp : appInfo.requiresSmallestWidthDp; if (compat < required) { compat = required; } if (compat >= sw) { compatFlags |= NEVER_COMPAT; } else if (forceCompat) { compatFlags |= NEEDS_SCREEN_COMPAT; } // Modern apps always support densities. applicationDensity = DisplayMetrics.DENSITY_DEVICE; applicationScale = 1.0f; applicationInvertedScale = 1.0f; } else { // We can't rely on the application always setting // FLAG_RESIZEABLE_FOR_SCREENS so will compute it based on various input. boolean anyResizeable = false; Loading Loading @@ -191,6 +216,7 @@ public class CompatibilityInfo implements Parcelable { applicationInvertedScale = 1.0f / applicationScale; compatFlags |= SCALING_REQUIRED; } } mCompatibilityFlags = compatFlags; } Loading