summaryrefslogtreecommitdiff
path: root/core/java/android/content
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-06-03 14:43:18 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-06-03 14:43:18 -0700
commit2515db74fe2e75018f618591fabe23fda8362bf3 (patch)
treed581c08117c382c1d63b7a48e141be0fce755093 /core/java/android/content
parentce08f785604e15ec56b1e2e21f4058eec3c923d3 (diff)
parent3a80c50485809fe72d6de83dacad494c5e84ed24 (diff)
am 3a80c504: am 8b9a2b6c: am e6676351: Work around OpenFeint bug.
* commit '3a80c50485809fe72d6de83dacad494c5e84ed24': Work around OpenFeint bug.
Diffstat (limited to 'core/java/android/content')
-rw-r--r--core/java/android/content/pm/ActivityInfo.java31
-rw-r--r--core/java/android/content/pm/PackageParser.java5
2 files changed, 29 insertions, 7 deletions
diff --git a/core/java/android/content/pm/ActivityInfo.java b/core/java/android/content/pm/ActivityInfo.java
index 4285388af73b..4858f1498f60 100644
--- a/core/java/android/content/pm/ActivityInfo.java
+++ b/core/java/android/content/pm/ActivityInfo.java
@@ -335,13 +335,25 @@ public class ActivityInfo extends ComponentInfo
/**
* Bit in {@link #configChanges} that indicates that the activity
* can itself handle the screen size. Set from the
- * {@link android.R.attr#configChanges} attribute.
+ * {@link android.R.attr#configChanges} attribute. This will be
+ * set by default for applications that target an earlier version
+ * than {@link android.os.Build.VERSION_CODES#HONEYCOMB_MR2}...
+ * <b>however</b>, you will not see the bit set here becomes some
+ * applications incorrectly compare {@link #configChanges} against
+ * an absolute value rather than correctly masking out the bits
+ * they are interested in. Please don't do that, thanks.
*/
public static final int CONFIG_SCREEN_SIZE = 0x0400;
/**
* Bit in {@link #configChanges} that indicates that the activity
* can itself handle the smallest screen size. Set from the
- * {@link android.R.attr#configChanges} attribute.
+ * {@link android.R.attr#configChanges} attribute. This will be
+ * set by default for applications that target an earlier version
+ * than {@link android.os.Build.VERSION_CODES#HONEYCOMB_MR2}...
+ * <b>however</b>, you will not see the bit set here becomes some
+ * applications incorrectly compare {@link #configChanges} against
+ * an absolute value rather than correctly masking out the bits
+ * they are interested in. Please don't do that, thanks.
*/
public static final int CONFIG_SMALLEST_SCREEN_SIZE = 0x0800;
/**
@@ -386,6 +398,21 @@ public class ActivityInfo extends ComponentInfo
}
/**
+ * @hide
+ * Unfortunately some developers (OpenFeint I am looking at you) have
+ * compared the configChanges bit field against absolute values, so if we
+ * introduce a new bit they break. To deal with that, we will make sure
+ * the public field will not have a value that breaks them, and let the
+ * framework call here to get the real value.
+ */
+ public int getRealConfigChanged() {
+ return applicationInfo.targetSdkVersion < android.os.Build.VERSION_CODES.HONEYCOMB_MR2
+ ? (configChanges | ActivityInfo.CONFIG_SCREEN_SIZE
+ | ActivityInfo.CONFIG_SMALLEST_SCREEN_SIZE)
+ : configChanges;
+ }
+
+ /**
* Bit mask of kinds of configuration changes that this activity
* can handle itself (without being restarted by the system).
* Contains any combination of {@link #CONFIG_FONT_SCALE},
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index 5f9a95761d06..2becf22822e1 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -1948,11 +1948,6 @@ public class PackageParser {
a.info.configChanges = sa.getInt(
com.android.internal.R.styleable.AndroidManifestActivity_configChanges,
0);
- if (owner.applicationInfo.targetSdkVersion
- < android.os.Build.VERSION_CODES.HONEYCOMB_MR2) {
- a.info.configChanges |= ActivityInfo.CONFIG_SCREEN_SIZE
- | ActivityInfo.CONFIG_SMALLEST_SCREEN_SIZE;
- }
a.info.softInputMode = sa.getInt(
com.android.internal.R.styleable.AndroidManifestActivity_windowSoftInputMode,
0);