summaryrefslogtreecommitdiffstats
path: root/core/java/android
diff options
context:
space:
mode:
authorMitsuru Oshima <oshima@google.com>2009-07-21 09:51:05 -0700
committerMitsuru Oshima <oshima@google.com>2009-07-21 11:35:18 -0700
commit69fff4a72d4dfc9208db79d773ef3ca23350287e (patch)
tree7feb0dd665c7ea3512b512c8de358e760f956472 /core/java/android
parentda57856d749457e495bd860c4ff45aaaf87c9dab (diff)
downloadframeworks_base-69fff4a72d4dfc9208db79d773ef3ca23350287e.zip
frameworks_base-69fff4a72d4dfc9208db79d773ef3ca23350287e.tar.gz
frameworks_base-69fff4a72d4dfc9208db79d773ef3ca23350287e.tar.bz2
* Disable compatibility mode for all cases.
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/content/pm/ApplicationInfo.java3
-rw-r--r--core/java/android/content/pm/PackageParser.java17
2 files changed, 19 insertions, 1 deletions
diff --git a/core/java/android/content/pm/ApplicationInfo.java b/core/java/android/content/pm/ApplicationInfo.java
index 0d00f21..28a77a5 100644
--- a/core/java/android/content/pm/ApplicationInfo.java
+++ b/core/java/android/content/pm/ApplicationInfo.java
@@ -399,7 +399,8 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
* @hide
*/
public void disableCompatibilityMode() {
- flags |= FLAG_SUPPORTS_LARGE_SCREENS;
+ flags |= (FLAG_SUPPORTS_LARGE_SCREENS | FLAG_SUPPORTS_NORMAL_SCREENS |
+ FLAG_SUPPORTS_SMALL_SCREENS);
supportsDensities = ANY_DENSITIES_ARRAY;
}
}
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index cebb696..39c27aa 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -92,6 +92,8 @@ public class PackageParser {
private static final Object mSync = new Object();
private static WeakReference<byte[]> mReadBuffer;
+ private static boolean sCompatibilityModeEnabled = true;
+
static class ParsePackageItemArgs {
final Package owner;
final String[] outError;
@@ -2629,6 +2631,11 @@ public class PackageParser {
public static ApplicationInfo generateApplicationInfo(Package p, int flags) {
if (p == null) return null;
if (!copyNeeded(flags, p, null)) {
+ // CompatibilityMode is global state. It's safe to modify the instance
+ // of the package.
+ if (!sCompatibilityModeEnabled) {
+ p.applicationInfo.disableCompatibilityMode();
+ }
return p.applicationInfo;
}
@@ -2643,6 +2650,9 @@ public class PackageParser {
if ((flags & PackageManager.GET_SUPPORTS_DENSITIES) != 0) {
ai.supportsDensities = p.supportsDensities;
}
+ if (!sCompatibilityModeEnabled) {
+ ai.disableCompatibilityMode();
+ }
return ai;
}
@@ -2827,4 +2837,11 @@ public class PackageParser {
+ " " + service.info.name + "}";
}
}
+
+ /**
+ * @hide
+ */
+ public static void setCompatibilityModeEnabled(boolean compatibilityModeEnabled) {
+ sCompatibilityModeEnabled = compatibilityModeEnabled;
+ }
}