diff options
| author | 2013-08-13 19:38:01 +0000 | |
|---|---|---|
| committer | 2013-08-13 19:38:01 +0000 | |
| commit | 1beff4787110b92bea5b5c6c8cf67a757a2f0565 (patch) | |
| tree | 0ea9a294062b64ef73b402cd869378985b542f56 | |
| parent | 9955699d30eaab964549b8173fe9a52dca782877 (diff) | |
| parent | 31678b52e4b65e8e4d22ef5dced713424e5deada (diff) | |
Merge "Fix Configuration layout direction comparison." into klp-dev
| -rw-r--r-- | core/java/android/content/res/Configuration.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/core/java/android/content/res/Configuration.java b/core/java/android/content/res/Configuration.java index 1c281387fce8..0402eeb94764 100644 --- a/core/java/android/content/res/Configuration.java +++ b/core/java/android/content/res/Configuration.java @@ -786,9 +786,11 @@ public final class Configuration implements Parcelable, Comparable<Configuration // 2 most significant bits in screenLayout). setLayoutDirection(locale); } - if (delta.screenLayout != 0 && screenLayout != delta.screenLayout) { + final int deltaScreenLayoutDir = delta.screenLayout & SCREENLAYOUT_LAYOUTDIR_MASK; + if (deltaScreenLayoutDir != SCREENLAYOUT_LAYOUTDIR_UNDEFINED && + deltaScreenLayoutDir != (screenLayout & SCREENLAYOUT_LAYOUTDIR_MASK)) { + screenLayout = (screenLayout & ~SCREENLAYOUT_LAYOUTDIR_MASK) | deltaScreenLayoutDir; changed |= ActivityInfo.CONFIG_LAYOUT_DIRECTION; - setLayoutDirection(locale); } if (delta.userSetLocale && (!userSetLocale || ((changed & ActivityInfo.CONFIG_LOCALE) != 0))) { @@ -937,7 +939,9 @@ public final class Configuration implements Parcelable, Comparable<Configuration changed |= ActivityInfo.CONFIG_LOCALE; changed |= ActivityInfo.CONFIG_LAYOUT_DIRECTION; } - if (delta.screenLayout != 0 && screenLayout != delta.screenLayout) { + final int deltaScreenLayoutDir = delta.screenLayout & SCREENLAYOUT_LAYOUTDIR_MASK; + if (deltaScreenLayoutDir != SCREENLAYOUT_LAYOUTDIR_UNDEFINED && + deltaScreenLayoutDir != (screenLayout & SCREENLAYOUT_LAYOUTDIR_MASK)) { changed |= ActivityInfo.CONFIG_LAYOUT_DIRECTION; } if (delta.touchscreen != TOUCHSCREEN_UNDEFINED |