diff options
author | Dianne Hackborn <hackbod@google.com> | 2011-06-07 14:09:47 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2011-06-08 18:45:43 -0700 |
commit | 5fd2169eabd77e6bfafaf456e58051a3bafb2bca (patch) | |
tree | 77048c3540c64cad77e5c140b6477a321190c586 /core/java/android/content/res/Configuration.java | |
parent | 4381f6421ca408d1dc66430ddfb107c5011bfe25 (diff) | |
download | frameworks_base-5fd2169eabd77e6bfafaf456e58051a3bafb2bca.zip frameworks_base-5fd2169eabd77e6bfafaf456e58051a3bafb2bca.tar.gz frameworks_base-5fd2169eabd77e6bfafaf456e58051a3bafb2bca.tar.bz2 |
Work on issue #4518815: Compatibility mode introduces compatibility regression...
...for Market App iRunner
There were a lot of serious issues with how we updated (or often didn't update)
the display and resource state when switching compatibility mode in conjunction
with restarting and updating application components. This addresses everything
I could find.
Unfortunately it does *not* fix this particular app. I am starting to think this
is just an issue in the app. This change does fix a number of other problems
I could repro, such as switching the compatibility mode of an IME.
Also a few changes here and there to get rid of $#*&^!! debug logs.
Change-Id: Ib15572eac9ec93b4b9966ddcbbc830ce9dec1317
Diffstat (limited to 'core/java/android/content/res/Configuration.java')
-rw-r--r-- | core/java/android/content/res/Configuration.java | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/core/java/android/content/res/Configuration.java b/core/java/android/content/res/Configuration.java index 6409aac..e2c6483 100644 --- a/core/java/android/content/res/Configuration.java +++ b/core/java/android/content/res/Configuration.java @@ -269,6 +269,13 @@ public final class Configuration implements Parcelable, Comparable<Configuration */ public int smallestScreenWidthDp; + /** @hide Hack to get this information from WM to app running in compat mode. */ + public int compatScreenWidthDp; + /** @hide Hack to get this information from WM to app running in compat mode. */ + public int compatScreenHeightDp; + /** @hide Hack to get this information from WM to app running in compat mode. */ + public int compatSmallestScreenWidthDp; + /** * @hide Internal book-keeping. */ @@ -309,6 +316,9 @@ public final class Configuration implements Parcelable, Comparable<Configuration screenWidthDp = o.screenWidthDp; screenHeightDp = o.screenHeightDp; smallestScreenWidthDp = o.smallestScreenWidthDp; + compatScreenWidthDp = o.compatScreenWidthDp; + compatScreenHeightDp = o.compatScreenHeightDp; + compatSmallestScreenWidthDp = o.compatSmallestScreenWidthDp; seq = o.seq; } @@ -444,9 +454,9 @@ public final class Configuration implements Parcelable, Comparable<Configuration orientation = ORIENTATION_UNDEFINED; screenLayout = SCREENLAYOUT_SIZE_UNDEFINED; uiMode = UI_MODE_TYPE_UNDEFINED; - screenWidthDp = SCREEN_WIDTH_DP_UNDEFINED; - screenHeightDp = SCREEN_HEIGHT_DP_UNDEFINED; - smallestScreenWidthDp = SMALLEST_SCREEN_WIDTH_DP_UNDEFINED; + screenWidthDp = compatScreenWidthDp = SCREEN_WIDTH_DP_UNDEFINED; + screenHeightDp = compatScreenHeightDp = SCREEN_HEIGHT_DP_UNDEFINED; + smallestScreenWidthDp = compatSmallestScreenWidthDp = SMALLEST_SCREEN_WIDTH_DP_UNDEFINED; seq = 0; } @@ -550,11 +560,18 @@ public final class Configuration implements Parcelable, Comparable<Configuration changed |= ActivityInfo.CONFIG_SCREEN_SIZE; screenHeightDp = delta.screenHeightDp; } - if (delta.smallestScreenWidthDp != SMALLEST_SCREEN_WIDTH_DP_UNDEFINED - && smallestScreenWidthDp != delta.smallestScreenWidthDp) { - changed |= ActivityInfo.CONFIG_SMALLEST_SCREEN_SIZE; + if (delta.smallestScreenWidthDp != SMALLEST_SCREEN_WIDTH_DP_UNDEFINED) { smallestScreenWidthDp = delta.smallestScreenWidthDp; } + if (delta.compatScreenWidthDp != SCREEN_WIDTH_DP_UNDEFINED) { + compatScreenWidthDp = delta.compatScreenWidthDp; + } + if (delta.compatScreenHeightDp != SCREEN_HEIGHT_DP_UNDEFINED) { + compatScreenHeightDp = delta.compatScreenHeightDp; + } + if (delta.compatSmallestScreenWidthDp != SMALLEST_SCREEN_WIDTH_DP_UNDEFINED) { + compatSmallestScreenWidthDp = delta.compatSmallestScreenWidthDp; + } if (delta.seq != 0) { seq = delta.seq; @@ -739,6 +756,9 @@ public final class Configuration implements Parcelable, Comparable<Configuration dest.writeInt(screenWidthDp); dest.writeInt(screenHeightDp); dest.writeInt(smallestScreenWidthDp); + dest.writeInt(compatScreenWidthDp); + dest.writeInt(compatScreenHeightDp); + dest.writeInt(compatSmallestScreenWidthDp); dest.writeInt(seq); } @@ -763,6 +783,9 @@ public final class Configuration implements Parcelable, Comparable<Configuration screenWidthDp = source.readInt(); screenHeightDp = source.readInt(); smallestScreenWidthDp = source.readInt(); + compatScreenWidthDp = source.readInt(); + compatScreenHeightDp = source.readInt(); + compatSmallestScreenWidthDp = source.readInt(); seq = source.readInt(); } |