Simplify density compatibility to a boolean.
Instead of a list, we now just have a single boolean indicating whether an application is density aware, and this set set to true by default as of Donut.
This commit is contained in:
@ -2231,6 +2231,17 @@
|
||||
visibility="public"
|
||||
>
|
||||
</field>
|
||||
<field name="anyDensity"
|
||||
type="int"
|
||||
transient="false"
|
||||
volatile="false"
|
||||
value="16843372"
|
||||
static="true"
|
||||
final="true"
|
||||
deprecated="not deprecated"
|
||||
visibility="public"
|
||||
>
|
||||
</field>
|
||||
<field name="apiKey"
|
||||
type="int"
|
||||
transient="false"
|
||||
@ -3078,17 +3089,6 @@
|
||||
visibility="public"
|
||||
>
|
||||
</field>
|
||||
<field name="density"
|
||||
type="int"
|
||||
transient="false"
|
||||
volatile="false"
|
||||
value="16843372"
|
||||
static="true"
|
||||
final="true"
|
||||
deprecated="not deprecated"
|
||||
visibility="public"
|
||||
>
|
||||
</field>
|
||||
<field name="dependency"
|
||||
type="int"
|
||||
transient="false"
|
||||
@ -35540,6 +35540,17 @@
|
||||
visibility="public"
|
||||
>
|
||||
</field>
|
||||
<field name="FLAG_SUPPORTS_SCREEN_DENSITIES"
|
||||
type="int"
|
||||
transient="false"
|
||||
volatile="false"
|
||||
value="8192"
|
||||
static="true"
|
||||
final="true"
|
||||
deprecated="not deprecated"
|
||||
visibility="public"
|
||||
>
|
||||
</field>
|
||||
<field name="FLAG_SUPPORTS_SMALL_SCREENS"
|
||||
type="int"
|
||||
transient="false"
|
||||
@ -35695,17 +35706,6 @@
|
||||
visibility="public"
|
||||
>
|
||||
</field>
|
||||
<field name="supportsDensities"
|
||||
type="int[]"
|
||||
transient="false"
|
||||
volatile="false"
|
||||
value="null"
|
||||
static="false"
|
||||
final="false"
|
||||
deprecated="not deprecated"
|
||||
visibility="public"
|
||||
>
|
||||
</field>
|
||||
<field name="targetSdkVersion"
|
||||
type="int"
|
||||
transient="false"
|
||||
@ -37604,17 +37604,6 @@
|
||||
visibility="public"
|
||||
>
|
||||
</field>
|
||||
<field name="GET_SUPPORTS_DENSITIES"
|
||||
type="int"
|
||||
transient="false"
|
||||
volatile="false"
|
||||
value="32768"
|
||||
static="true"
|
||||
final="true"
|
||||
deprecated="not deprecated"
|
||||
visibility="public"
|
||||
>
|
||||
</field>
|
||||
<field name="GET_UNINSTALLED_PACKAGES"
|
||||
type="int"
|
||||
transient="false"
|
||||
|
@ -168,21 +168,22 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
*/
|
||||
public static final int FLAG_RESIZEABLE_FOR_SCREENS = 1<<12;
|
||||
|
||||
/**
|
||||
* Value for {@link #flags}: true when the application knows how to
|
||||
* accomodate different screen densities. Corresponds to
|
||||
* {@link android.R.styleable#AndroidManifestSupportsScreens_anyDensity
|
||||
* android:anyDensity}.
|
||||
*/
|
||||
public static final int FLAG_SUPPORTS_SCREEN_DENSITIES = 1<<13;
|
||||
|
||||
/**
|
||||
* Value for {@link #flags}: this is false if the application has set
|
||||
* its android:allowBackup to false, true otherwise.
|
||||
*
|
||||
* {@hide}
|
||||
*/
|
||||
public static final int FLAG_ALLOW_BACKUP = 1<<13;
|
||||
public static final int FLAG_ALLOW_BACKUP = 1<<14;
|
||||
|
||||
/**
|
||||
* Indicates that the application supports any densities;
|
||||
* {@hide}
|
||||
*/
|
||||
public static final int ANY_DENSITY = -1;
|
||||
static final int[] ANY_DENSITIES_ARRAY = { ANY_DENSITY };
|
||||
|
||||
/**
|
||||
* Flags associated with the application. Any combination of
|
||||
* {@link #FLAG_SYSTEM}, {@link #FLAG_DEBUGGABLE}, {@link #FLAG_HAS_CODE},
|
||||
@ -227,13 +228,6 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
*/
|
||||
public int uid;
|
||||
|
||||
/**
|
||||
* The list of densities in DPI that application supprots. This
|
||||
* field is only set if the {@link PackageManager#GET_SUPPORTS_DENSITIES} flag was
|
||||
* used when retrieving the structure.
|
||||
*/
|
||||
public int[] supportsDensities;
|
||||
|
||||
/**
|
||||
* The minimum SDK version this application targets. It may run on earilier
|
||||
* versions, but it knows how to work with any new behavior added at this
|
||||
@ -267,7 +261,6 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
pw.println(prefix + "enabled=" + enabled);
|
||||
pw.println(prefix + "manageSpaceActivityName="+manageSpaceActivityName);
|
||||
pw.println(prefix + "description=0x"+Integer.toHexString(descriptionRes));
|
||||
pw.println(prefix + "supportsDensities=" + supportsDensities);
|
||||
super.dumpBack(pw, prefix);
|
||||
}
|
||||
|
||||
@ -314,7 +307,6 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
enabled = orig.enabled;
|
||||
manageSpaceActivityName = orig.manageSpaceActivityName;
|
||||
descriptionRes = orig.descriptionRes;
|
||||
supportsDensities = orig.supportsDensities;
|
||||
}
|
||||
|
||||
|
||||
@ -346,7 +338,6 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
dest.writeString(manageSpaceActivityName);
|
||||
dest.writeString(backupAgentName);
|
||||
dest.writeInt(descriptionRes);
|
||||
dest.writeIntArray(supportsDensities);
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator<ApplicationInfo> CREATOR
|
||||
@ -377,7 +368,6 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
manageSpaceActivityName = source.readString();
|
||||
backupAgentName = source.readString();
|
||||
descriptionRes = source.readInt();
|
||||
supportsDensities = source.createIntArray();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -408,7 +398,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
*/
|
||||
public void disableCompatibilityMode() {
|
||||
flags |= (FLAG_SUPPORTS_LARGE_SCREENS | FLAG_SUPPORTS_NORMAL_SCREENS |
|
||||
FLAG_SUPPORTS_SMALL_SCREENS | FLAG_RESIZEABLE_FOR_SCREENS);
|
||||
supportsDensities = ANY_DENSITIES_ARRAY;
|
||||
FLAG_SUPPORTS_SMALL_SCREENS | FLAG_RESIZEABLE_FOR_SCREENS |
|
||||
FLAG_SUPPORTS_SCREEN_DENSITIES);
|
||||
}
|
||||
}
|
||||
|
@ -164,12 +164,6 @@ public abstract class PackageManager {
|
||||
*/
|
||||
public static final int GET_CONFIGURATIONS = 0x00004000;
|
||||
|
||||
/**
|
||||
* {@link ApplicationInfo} flag: return the
|
||||
* {@link ApplicationInfo#supportsDensities} that the package supports.
|
||||
*/
|
||||
public static final int GET_SUPPORTS_DENSITIES = 0x00008000;
|
||||
|
||||
/**
|
||||
* Resolution and querying flag: if set, only filters that support the
|
||||
* {@link android.content.Intent#CATEGORY_DEFAULT} will be considered for
|
||||
|
@ -675,6 +675,7 @@ public class PackageParser {
|
||||
int supportsNormalScreens = 1;
|
||||
int supportsLargeScreens = 1;
|
||||
int resizeable = 1;
|
||||
int anyDensity = 1;
|
||||
|
||||
int outerDepth = parser.getDepth();
|
||||
while ((type=parser.next()) != parser.END_DOCUMENT
|
||||
@ -854,21 +855,6 @@ public class PackageParser {
|
||||
|
||||
XmlUtils.skipCurrentTag(parser);
|
||||
|
||||
} else if (tagName.equals("supports-density")) {
|
||||
sa = res.obtainAttributes(attrs,
|
||||
com.android.internal.R.styleable.AndroidManifestSupportsDensity);
|
||||
|
||||
int density = sa.getInteger(
|
||||
com.android.internal.R.styleable.AndroidManifestSupportsDensity_density, -1);
|
||||
|
||||
sa.recycle();
|
||||
|
||||
if (density != -1 && !pkg.supportsDensityList.contains(density)) {
|
||||
pkg.supportsDensityList.add(density);
|
||||
}
|
||||
|
||||
XmlUtils.skipCurrentTag(parser);
|
||||
|
||||
} else if (tagName.equals("supports-screens")) {
|
||||
sa = res.obtainAttributes(attrs,
|
||||
com.android.internal.R.styleable.AndroidManifestSupportsScreens);
|
||||
@ -887,6 +873,9 @@ public class PackageParser {
|
||||
resizeable = sa.getInteger(
|
||||
com.android.internal.R.styleable.AndroidManifestSupportsScreens_resizeable,
|
||||
supportsLargeScreens);
|
||||
anyDensity = sa.getInteger(
|
||||
com.android.internal.R.styleable.AndroidManifestSupportsScreens_anyDensity,
|
||||
anyDensity);
|
||||
|
||||
sa.recycle();
|
||||
|
||||
@ -962,7 +951,7 @@ public class PackageParser {
|
||||
|
||||
if (supportsSmallScreens < 0 || (supportsSmallScreens > 0
|
||||
&& pkg.applicationInfo.targetSdkVersion
|
||||
>= android.os.Build.VERSION_CODES.CUR_DEVELOPMENT)) {
|
||||
>= android.os.Build.VERSION_CODES.DONUT)) {
|
||||
pkg.applicationInfo.flags |= ApplicationInfo.FLAG_SUPPORTS_SMALL_SCREENS;
|
||||
}
|
||||
if (supportsNormalScreens != 0) {
|
||||
@ -970,32 +959,19 @@ public class PackageParser {
|
||||
}
|
||||
if (supportsLargeScreens < 0 || (supportsLargeScreens > 0
|
||||
&& pkg.applicationInfo.targetSdkVersion
|
||||
>= android.os.Build.VERSION_CODES.CUR_DEVELOPMENT)) {
|
||||
>= android.os.Build.VERSION_CODES.DONUT)) {
|
||||
pkg.applicationInfo.flags |= ApplicationInfo.FLAG_SUPPORTS_LARGE_SCREENS;
|
||||
}
|
||||
if (resizeable < 0 || (resizeable > 0
|
||||
&& pkg.applicationInfo.targetSdkVersion
|
||||
>= android.os.Build.VERSION_CODES.CUR_DEVELOPMENT)) {
|
||||
>= android.os.Build.VERSION_CODES.DONUT)) {
|
||||
pkg.applicationInfo.flags |= ApplicationInfo.FLAG_RESIZEABLE_FOR_SCREENS;
|
||||
}
|
||||
int densities[] = null;
|
||||
int size = pkg.supportsDensityList.size();
|
||||
if (size > 0) {
|
||||
densities = pkg.supportsDensities = new int[size];
|
||||
List<Integer> densityList = pkg.supportsDensityList;
|
||||
for (int i = 0; i < size; i++) {
|
||||
densities[i] = densityList.get(i);
|
||||
}
|
||||
if (anyDensity < 0 || (anyDensity > 0
|
||||
&& pkg.applicationInfo.targetSdkVersion
|
||||
>= android.os.Build.VERSION_CODES.DONUT)) {
|
||||
pkg.applicationInfo.flags |= ApplicationInfo.FLAG_SUPPORTS_SCREEN_DENSITIES;
|
||||
}
|
||||
/**
|
||||
* TODO: enable this before code freeze. b/1967935
|
||||
* *
|
||||
if ((densities == null || densities.length == 0)
|
||||
&& (pkg.applicationInfo.targetSdkVersion
|
||||
>= android.os.Build.VERSION_CODES.CUR_DEVELOPMENT)) {
|
||||
pkg.supportsDensities = ApplicationInfo.ANY_DENSITIES_ARRAY;
|
||||
}
|
||||
*/
|
||||
|
||||
return pkg;
|
||||
}
|
||||
@ -2446,9 +2422,6 @@ public class PackageParser {
|
||||
// We store the application meta-data independently to avoid multiple unwanted references
|
||||
public Bundle mAppMetaData = null;
|
||||
|
||||
public final ArrayList<Integer> supportsDensityList = new ArrayList<Integer>();
|
||||
public int[] supportsDensities = null;
|
||||
|
||||
// If this is a 3rd party app, this is the path of the zip file.
|
||||
public String mPath;
|
||||
|
||||
@ -2630,10 +2603,6 @@ public class PackageParser {
|
||||
&& p.usesLibraryFiles != null) {
|
||||
return true;
|
||||
}
|
||||
if ((flags & PackageManager.GET_SUPPORTS_DENSITIES) != 0
|
||||
&& p.supportsDensities != null) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -2656,9 +2625,6 @@ public class PackageParser {
|
||||
if ((flags & PackageManager.GET_SHARED_LIBRARY_FILES) != 0) {
|
||||
ai.sharedLibraryFiles = p.usesLibraryFiles;
|
||||
}
|
||||
if ((flags & PackageManager.GET_SUPPORTS_DENSITIES) != 0) {
|
||||
ai.supportsDensities = p.supportsDensities;
|
||||
}
|
||||
if (!sCompatibilityModeEnabled) {
|
||||
ai.disableCompatibilityMode();
|
||||
}
|
||||
|
@ -131,41 +131,15 @@ public class CompatibilityInfo {
|
||||
mCompatibilityFlags |= EXPANDABLE | CONFIGURED_EXPANDABLE;
|
||||
}
|
||||
|
||||
float packageDensityScale = -1.0f;
|
||||
int packageDensity = 0;
|
||||
if (appInfo.supportsDensities != null) {
|
||||
int minDiff = Integer.MAX_VALUE;
|
||||
for (int density : appInfo.supportsDensities) {
|
||||
if (density == ApplicationInfo.ANY_DENSITY) {
|
||||
packageDensity = DisplayMetrics.DENSITY_DEVICE;
|
||||
packageDensityScale = 1.0f;
|
||||
break;
|
||||
}
|
||||
int tmpDiff = Math.abs(DisplayMetrics.DENSITY_DEVICE - density);
|
||||
if (tmpDiff == 0) {
|
||||
packageDensity = DisplayMetrics.DENSITY_DEVICE;
|
||||
packageDensityScale = 1.0f;
|
||||
break;
|
||||
}
|
||||
// prefer higher density (appScale>1.0), unless that's only option.
|
||||
if (tmpDiff < minDiff && packageDensityScale < 1.0f) {
|
||||
packageDensity = density;
|
||||
packageDensityScale = DisplayMetrics.DENSITY_DEVICE / (float) density;
|
||||
minDiff = tmpDiff;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (packageDensityScale > 0.0f) {
|
||||
applicationDensity = packageDensity;
|
||||
applicationScale = packageDensityScale;
|
||||
if ((appInfo.flags & ApplicationInfo.FLAG_SUPPORTS_SCREEN_DENSITIES) != 0) {
|
||||
applicationDensity = DisplayMetrics.DENSITY_DEVICE;
|
||||
applicationScale = 1.0f;
|
||||
applicationInvertedScale = 1.0f;
|
||||
} else {
|
||||
applicationDensity = DisplayMetrics.DENSITY_DEFAULT;
|
||||
applicationScale =
|
||||
DisplayMetrics.DENSITY_DEVICE / (float) DisplayMetrics.DENSITY_DEFAULT;
|
||||
}
|
||||
|
||||
applicationInvertedScale = 1.0f / applicationScale;
|
||||
if (applicationScale != 1.0f) {
|
||||
applicationScale = DisplayMetrics.DENSITY_DEVICE
|
||||
/ (float) DisplayMetrics.DENSITY_DEFAULT;
|
||||
applicationInvertedScale = 1.0f / applicationScale;
|
||||
mCompatibilityFlags |= SCALING_REQUIRED;
|
||||
}
|
||||
}
|
||||
|
@ -827,28 +827,6 @@
|
||||
<attr name="name" />
|
||||
</declare-styleable>
|
||||
|
||||
<!-- The <code>supports-density</code> specifies a screen density that this
|
||||
package supports. Application can specify multiple densities it supports.
|
||||
<p>This appears as a child tag of the
|
||||
{@link #AndroidManifest manifest} tag. -->
|
||||
<declare-styleable name="AndroidManifestSupportsDensity" parent="AndroidManifest">
|
||||
<!-- Required value of the density in dip (device independent pixel).
|
||||
You should use one of the pre-defined constants for the standard
|
||||
screen densities defined here.
|
||||
-->
|
||||
<attr name="density" format="integer">
|
||||
<!-- A low density screen, such as a QVGA or WQVGA screen in a
|
||||
typical hand-held phone. The constant for this is 120. -->
|
||||
<enum name="low" value="120" />
|
||||
<!-- A medium density screen, such as an HVGA screen in a
|
||||
typical hand-held phone. The constant for this is 160. -->
|
||||
<enum name="medium" value="160" />
|
||||
<!-- A high density screen, such as a VGA or WVGA screen in a
|
||||
typical hand-held phone. The constant for this is 240. -->
|
||||
<enum name="high" value="240" />
|
||||
</attr>
|
||||
</declare-styleable>
|
||||
|
||||
<!-- The <code>supports-screens</code> specifies the screen dimensions an
|
||||
application supports. By default a modern application supports all
|
||||
screen sizes and must explicitly disable certain screen sizes here;
|
||||
@ -892,6 +870,11 @@
|
||||
set for you automatically based on whether you are targeting
|
||||
a newer platform that supports more screens. -->
|
||||
<attr name="resizeable" format="boolean" />
|
||||
<!-- Indicates whether the application can accommodate any screen
|
||||
density. Older applications are assumed to not be able to,
|
||||
new ones able to. You can explicitly supply your abilities
|
||||
here. -->
|
||||
<attr name="anyDensity" format="boolean" />
|
||||
</declare-styleable>
|
||||
|
||||
<!-- Private tag to declare system protected broadcast actions.
|
||||
|
@ -1093,7 +1093,7 @@
|
||||
|
||||
<public type="attr" name="tension" id="0x0101026a" />
|
||||
<public type="attr" name="extraTension" />
|
||||
<public type="attr" name="density" />
|
||||
<public type="attr" name="anyDensity" />
|
||||
<public type="attr" name="searchSuggestThreshold" />
|
||||
<public type="attr" name="includeInGlobalSearch" />
|
||||
<public type="attr" name="onClick" />
|
||||
|
@ -465,37 +465,37 @@ MyApp/
|
||||
</tr>
|
||||
<tr>
|
||||
<td>MCC and MNC</td>
|
||||
<td>The mobile country code optionally followed by mobile network code
|
||||
<td><p>The mobile country code optionally followed by mobile network code
|
||||
from the SIM in the device. For example
|
||||
<code>mcc310</code> (U.S. on any carrier);
|
||||
<code>mcc310-mnc004</code> (U.S., Verizon brand);
|
||||
<code>mcc208-mnc00</code> (France, Orange brand);
|
||||
<code>mcc234-mnc00</code> (U.K., BT brand).
|
||||
<p>
|
||||
</p><p>
|
||||
If the device uses a radio connection (GSM phone), the MCC will come
|
||||
from the SIM, and the MNC will come from the network to which the
|
||||
device is attached. You might sometimes use the MCC alone, for example
|
||||
to include country-specific legal resources in your application. If
|
||||
your application specifies resources for a MCC/MNC combination, those
|
||||
resources can only be used if both the MCC and the MNC match. </td>
|
||||
resources can only be used if both the MCC and the MNC match. </p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Language and region</td>
|
||||
<td>The two letter <a href="http://www.loc.gov/standards/iso639-2/php/code_list.php">ISO
|
||||
<td><p>The two letter <a href="http://www.loc.gov/standards/iso639-2/php/code_list.php">ISO
|
||||
639-1</a> language code optionally followed by a two letter
|
||||
<a href="http://www.iso.org/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html">ISO
|
||||
3166-1-alpha-2</a> region code (preceded by lowercase "r"). For example
|
||||
<code>fr</code>, <code>en-rUS</code>, <code>fr-rFR</code>, <code>es-rES</code>.
|
||||
<p>
|
||||
</p><p>
|
||||
The codes are <em>not</em> case-sensitive; the r prefix is used to
|
||||
distinguish the region portion.
|
||||
You cannot specify a region alone, but you can specify a language alone,
|
||||
for example <code>en</code>, <code>fr</code>, <code>es</code>. </td>
|
||||
for example <code>en</code>, <code>fr</code>, <code>es</code>.</p> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Screen dimensions</td>
|
||||
<td><code>small</code>, <code>normal</code>, <code>large</code>
|
||||
<p>
|
||||
<td><p><code>small</code>, <code>normal</code>, <code>large</code>
|
||||
</p><p>
|
||||
Specify that the resource is for a particular class of screen.
|
||||
The meanings of these are:</p>
|
||||
<ul>
|
||||
@ -517,27 +517,27 @@ MyApp/
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Wider/taller screens</td>
|
||||
<td><code>long</code>, <code>notlong</code>
|
||||
<p>
|
||||
<td><p><code>long</code>, <code>notlong</code>
|
||||
</p><p>
|
||||
Specify that the resource is for a taller/wider than traditional
|
||||
screen. This is based purely on the aspect ration of the screen:
|
||||
QVGA, HVGA, and VGA are notlong; WQVGA, WVGA, FWVGA are long. Note
|
||||
that long may mean either wide or tall, depending on the current
|
||||
orientation.
|
||||
orientation.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Screen orientation</td>
|
||||
<td><code>port</code>, <code>land</code>, <code>square</code>
|
||||
<p>
|
||||
<td><p><code>port</code>, <code>land</code>, <code>square</code>
|
||||
</p><p>
|
||||
Specifies that the resource is for a screen that is tall (port)
|
||||
or wide (land); square is not currently used.
|
||||
or wide (land); square is not currently used.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Screen pixel density</td>
|
||||
<td><code>ldpi</code>, <code>mdpi</code>, <code>hdpi</code>, <code>nodpi</code>
|
||||
<p>
|
||||
<td><p><code>ldpi</code>, <code>mdpi</code>, <code>hdpi</code>, <code>nodpi</code>
|
||||
</p><p>
|
||||
Specifies the screen density the resource is defined for. The medium
|
||||
density of traditional HVGA screens (mdpi) is defined to be approximately
|
||||
160dpi; low density (ldpi) is 120, and high density (hdpi) is 240. There
|
||||
@ -545,7 +545,7 @@ MyApp/
|
||||
in ldpi would be 12x12 is mdpi and 16x16 in hdpi. The special
|
||||
<code>nodpi</code> density can be used with bitmap resources to prevent
|
||||
them from being scaled at load time to match the device density.
|
||||
<p>
|
||||
</p><p>
|
||||
When Android selects which resource files to use,
|
||||
it handles screen density differently than the other qualifiers.
|
||||
In step 1 of <a href="#best-match">How Android finds the best
|
||||
@ -553,10 +553,11 @@ MyApp/
|
||||
be a match. In step 4, if the qualifier being considered is screen
|
||||
density, Android will select the best final match at that point,
|
||||
without any need to move on to step 5.
|
||||
<p>
|
||||
</p><p>
|
||||
You can also specify explicit densities like <code>92dpi</code>
|
||||
or <code>108dpi</code>, but these are not fully supported by the
|
||||
system so should not be used.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -565,9 +566,9 @@ MyApp/
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Whether the keyboard is available to the user</td>
|
||||
<td><code>keysexposed</code>, <code>keyshidden</code>, <code>keyssoft</code>
|
||||
<p>
|
||||
If your application has specific resources that should only be used with a soft keyboard, use the <code>keyssoft</code> value. If no <code>keyssoft</code> resources are available (only <code>keysexposed</code> and <code>keyshidden</code>) and the device shows a soft keyboard, the system will use <code>keysexposed</code> resources. </td>
|
||||
<td><p><code>keysexposed</code>, <code>keyshidden</code>, <code>keyssoft</code>
|
||||
</p><p>
|
||||
If your application has specific resources that should only be used with a soft keyboard, use the <code>keyssoft</code> value. If no <code>keyssoft</code> resources are available (only <code>keysexposed</code> and <code>keyshidden</code>) and the device shows a soft keyboard, the system will use <code>keysexposed</code> resources.</p> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Primary text input method</td>
|
||||
|
@ -4902,26 +4902,40 @@ class PackageManagerService extends IPackageManager.Stub {
|
||||
if (ps.pkg != null) {
|
||||
pw.print(" dataDir="); pw.println(ps.pkg.applicationInfo.dataDir);
|
||||
pw.print(" targetSdk="); pw.println(ps.pkg.applicationInfo.targetSdkVersion);
|
||||
pw.print(" densities="); pw.println(ps.pkg.supportsDensityList);
|
||||
ArrayList<String> screens = new ArrayList<String>();
|
||||
pw.print(" supportsScreens=[");
|
||||
boolean first = true;
|
||||
if ((ps.pkg.applicationInfo.flags &
|
||||
ApplicationInfo.FLAG_SUPPORTS_NORMAL_SCREENS) != 0) {
|
||||
screens.add("medium");
|
||||
if (!first) pw.print(", ");
|
||||
first = false;
|
||||
pw.print("medium");
|
||||
}
|
||||
if ((ps.pkg.applicationInfo.flags &
|
||||
ApplicationInfo.FLAG_SUPPORTS_LARGE_SCREENS) != 0) {
|
||||
screens.add("large");
|
||||
if (!first) pw.print(", ");
|
||||
first = false;
|
||||
pw.print("large");
|
||||
}
|
||||
if ((ps.pkg.applicationInfo.flags &
|
||||
ApplicationInfo.FLAG_SUPPORTS_SMALL_SCREENS) != 0) {
|
||||
screens.add("small,");
|
||||
if (!first) pw.print(", ");
|
||||
first = false;
|
||||
pw.print("small");
|
||||
}
|
||||
if ((ps.pkg.applicationInfo.flags &
|
||||
ApplicationInfo.FLAG_RESIZEABLE_FOR_SCREENS) != 0) {
|
||||
screens.add("resizeable,");
|
||||
if (!first) pw.print(", ");
|
||||
first = false;
|
||||
pw.print("resizeable");
|
||||
}
|
||||
if ((ps.pkg.applicationInfo.flags &
|
||||
ApplicationInfo.FLAG_SUPPORTS_SCREEN_DENSITIES) != 0) {
|
||||
if (!first) pw.print(", ");
|
||||
first = false;
|
||||
pw.print("anyDensity");
|
||||
}
|
||||
pw.print(" supportsScreens="); pw.println(screens);
|
||||
}
|
||||
pw.println("]");
|
||||
pw.print(" timeStamp="); pw.println(ps.getTimeStampStr());
|
||||
pw.print(" signatures="); pw.println(ps.signatures);
|
||||
pw.print(" permissionsFixed="); pw.print(ps.permissionsFixed);
|
||||
|
@ -184,8 +184,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
|
||||
static final int LOG_BOOT_PROGRESS_ENABLE_SCREEN = 3050;
|
||||
|
||||
// The flags that are set for all calls we make to the package manager.
|
||||
static final int STOCK_PM_FLAGS = PackageManager.GET_SHARED_LIBRARY_FILES
|
||||
| PackageManager.GET_SUPPORTS_DENSITIES;
|
||||
static final int STOCK_PM_FLAGS = PackageManager.GET_SHARED_LIBRARY_FILES;
|
||||
|
||||
private static final String SYSTEM_SECURE = "ro.secure";
|
||||
|
||||
|
@ -52,14 +52,13 @@ public class DpiTestActivity extends Activity {
|
||||
// be doing it.
|
||||
Application app = ActivityThread.currentActivityThread().getApplication();
|
||||
ApplicationInfo ai = app.getPackageManager().getApplicationInfo(
|
||||
"com.google.android.test.dpi",
|
||||
PackageManager.GET_SUPPORTS_DENSITIES);
|
||||
"com.google.android.test.dpi", 0);
|
||||
if (noCompat) {
|
||||
ai.flags |= ApplicationInfo.FLAG_SUPPORTS_LARGE_SCREENS
|
||||
| ApplicationInfo.FLAG_SUPPORTS_NORMAL_SCREENS
|
||||
| ApplicationInfo.FLAG_SUPPORTS_SMALL_SCREENS
|
||||
| ApplicationInfo.FLAG_RESIZEABLE_FOR_SCREENS;
|
||||
ai.supportsDensities = new int[] { ApplicationInfo.ANY_DENSITY };
|
||||
| ApplicationInfo.FLAG_RESIZEABLE_FOR_SCREENS
|
||||
| ApplicationInfo.FLAG_SUPPORTS_SCREEN_DENSITIES;
|
||||
app.getResources().setCompatibilityInfo(new CompatibilityInfo(ai));
|
||||
}
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
|
Reference in New Issue
Block a user