diff options
author | Fabrice Di Meglio <fdimeglio@google.com> | 2013-04-11 18:10:51 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-04-11 18:10:51 -0700 |
commit | b735e1d426d65007011a3d915ea8e2cdd0002ecb (patch) | |
tree | 00f6dbcb2b32e4ebb443a8eadfbb4bc1d143c64b /core/java/android/content | |
parent | 042a5b0a59bbae9884947169e0f35a860e69d125 (diff) | |
parent | 70d2c77320287d97fa2d90cc60f85e1706bffb1b (diff) | |
download | frameworks_base-b735e1d426d65007011a3d915ea8e2cdd0002ecb.zip frameworks_base-b735e1d426d65007011a3d915ea8e2cdd0002ecb.tar.gz frameworks_base-b735e1d426d65007011a3d915ea8e2cdd0002ecb.tar.bz2 |
am 70d2c773: am f5c757c6: Merge "More fix for bug #8159072 Spinner widget should be RTL\'ized" into jb-mr2-dev
* commit '70d2c77320287d97fa2d90cc60f85e1706bffb1b':
More fix for bug #8159072 Spinner widget should be RTL'ized
Diffstat (limited to 'core/java/android/content')
-rw-r--r-- | core/java/android/content/pm/ActivityInfo.java | 2 | ||||
-rw-r--r-- | core/java/android/content/res/Resources.java | 19 |
2 files changed, 12 insertions, 9 deletions
diff --git a/core/java/android/content/pm/ActivityInfo.java b/core/java/android/content/pm/ActivityInfo.java index 7ccae76..8154bca 100644 --- a/core/java/android/content/pm/ActivityInfo.java +++ b/core/java/android/content/pm/ActivityInfo.java @@ -426,7 +426,7 @@ public class ActivityInfo extends ComponentInfo * Bit in {@link #configChanges} that indicates that the activity * can itself handle changes to the font scaling factor. Set from the * {@link android.R.attr#configChanges} attribute. This is - * not a core resource configutation, but a higher-level value, so its + * not a core resource configuration, but a higher-level value, so its * constant starts at the high bits. */ public static final int CONFIG_FONT_SCALE = 0x40000000; diff --git a/core/java/android/content/res/Resources.java b/core/java/android/content/res/Resources.java index 0152615..9338f3d 100644 --- a/core/java/android/content/res/Resources.java +++ b/core/java/android/content/res/Resources.java @@ -1977,17 +1977,20 @@ public class Resources { } } - private boolean verifyPreloadConfig(TypedValue value, String name) { - if ((value.changingConfigurations&~(ActivityInfo.CONFIG_FONT_SCALE - | ActivityInfo.CONFIG_DENSITY)) != 0) { + static private final int VARYING_CONFIGS = ActivityInfo.activityInfoConfigToNative( + ActivityInfo.CONFIG_LAYOUT_DIRECTION); + + private boolean verifyPreloadConfig(int changingConfigurations, int resourceId, String name) { + if (((changingConfigurations&~(ActivityInfo.CONFIG_FONT_SCALE | + ActivityInfo.CONFIG_DENSITY)) & VARYING_CONFIGS) != 0) { String resName; try { - resName = getResourceName(value.resourceId); + resName = getResourceName(resourceId); } catch (NotFoundException e) { resName = "?"; } Log.w(TAG, "Preloaded " + name + " resource #0x" - + Integer.toHexString(value.resourceId) + + Integer.toHexString(resourceId) + " (" + resName + ") that varies with configuration!!"); return false; } @@ -2090,7 +2093,7 @@ public class Resources { cs = dr.getConstantState(); if (cs != null) { if (mPreloading) { - if (verifyPreloadConfig(value, "drawable")) { + if (verifyPreloadConfig(cs.getChangingConfigurations(), value.resourceId, "drawable")) { if (isColorDrawable) { sPreloadedColorDrawables.put(key, cs); } else { @@ -2160,7 +2163,7 @@ public class Resources { csl = ColorStateList.valueOf(value.data); if (mPreloading) { - if (verifyPreloadConfig(value, "color")) { + if (verifyPreloadConfig(value.changingConfigurations, value.resourceId, "color")) { sPreloadedColorStateLists.put(key, csl); } } @@ -2206,7 +2209,7 @@ public class Resources { if (csl != null) { if (mPreloading) { - if (verifyPreloadConfig(value, "color")) { + if (verifyPreloadConfig(value.changingConfigurations, value.resourceId, "color")) { sPreloadedColorStateLists.put(key, csl); } } else { |