diff options
| author | John Reck <jreck@google.com> | 2015-07-13 14:42:43 -0700 |
|---|---|---|
| committer | John Reck <jreck@google.com> | 2015-07-13 14:42:43 -0700 |
| commit | 4feb3260152b2ddbd4a96c43c09cd1ed3cf2d3fb (patch) | |
| tree | 9123198496c270a92c7b82b910f28db4c7a9161f /core/java/android | |
| parent | cf9aebf138a3ec07277b1e5564751d2396a155c0 (diff) | |
| download | frameworks_base-4feb3260152b2ddbd4a96c43c09cd1ed3cf2d3fb.zip frameworks_base-4feb3260152b2ddbd4a96c43c09cd1ed3cf2d3fb.tar.gz frameworks_base-4feb3260152b2ddbd4a96c43c09cd1ed3cf2d3fb.tar.bz2 | |
Improve resource loading by ~3x
Bug: 22392651
ColorStateLists were never cached because the lazy-create
of the constant state had a typo.
Resource caching in general was broken because ThemeKey did not
clone the hash code, so all keys in the cache had a hashCode
of 0 which did not match the real, uncloned ThemeKeys hash code
so the binary search in ArrayMap based off of hash code was failing.
Change-Id: I9df1628b226bfa797bed97875354c19bf64f41ad
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/content/res/ColorStateList.java | 2 | ||||
| -rw-r--r-- | core/java/android/content/res/Resources.java | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/core/java/android/content/res/ColorStateList.java b/core/java/android/content/res/ColorStateList.java index 579634f..19921b5 100644 --- a/core/java/android/content/res/ColorStateList.java +++ b/core/java/android/content/res/ColorStateList.java @@ -603,7 +603,7 @@ public class ColorStateList implements Parcelable { * @hide only for resource preloading */ public ConstantState<ColorStateList> getConstantState() { - if (mFactory != null) { + if (mFactory == null) { mFactory = new ColorStateListFactory(this); } return mFactory; diff --git a/core/java/android/content/res/Resources.java b/core/java/android/content/res/Resources.java index 9a99a46..731903c 100644 --- a/core/java/android/content/res/Resources.java +++ b/core/java/android/content/res/Resources.java @@ -1918,6 +1918,7 @@ public class Resources { other.mResId = mResId; other.mForce = mForce; other.mCount = mCount; + other.mHashCode = mHashCode; return other; } } |
