diff options
author | Adam Lesinski <adamlesinski@google.com> | 2016-07-13 12:09:24 -0700 |
---|---|---|
committer | gitbuildkicker <android-build@google.com> | 2016-07-13 20:30:43 -0700 |
commit | 0813c5aaa9ee870a4bac375e462c296aa28ef6a6 (patch) | |
tree | 4a42c893592162e19ab449dff4aeacd411298489 | |
parent | cad52fe423734c12aea2b8e90a2c15952777b536 (diff) | |
download | base-0813c5aaa9ee870a4bac375e462c296aa28ef6a6.tar.gz |
Don't hold on to AssetManager instancesandroid-cts-7.0_r2android-cts-7.0_r1android-7.0.0_r1afw-test-harness-2.1
If we enter multi-window mode or load WebView
assets into a Resources object, then the underlying
AssetManager instance may change.
crbug.com/627586
Bug:30118654
Change-Id: I837637bdad5370809db7f060d7d8536b536cad9e
-rw-r--r-- | core/java/android/content/res/TypedArray.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/java/android/content/res/TypedArray.java b/core/java/android/content/res/TypedArray.java index 92134ee01de8..1e44a5ccafc9 100644 --- a/core/java/android/content/res/TypedArray.java +++ b/core/java/android/content/res/TypedArray.java @@ -49,6 +49,10 @@ public class TypedArray { attrs.mLength = len; attrs.mRecycled = false; + // Reset the assets, which may have changed due to configuration changes + // or further resource loading. + attrs.mAssets = res.getAssets(); + final int fullLen = len * AssetManager.STYLE_NUM_ENTRIES; if (attrs.mData.length >= fullLen) { return attrs; @@ -66,7 +70,7 @@ public class TypedArray { private final Resources mResources; private final DisplayMetrics mMetrics; - private final AssetManager mAssets; + private AssetManager mAssets; private boolean mRecycled; @@ -1086,6 +1090,7 @@ public class TypedArray { // These may have been set by the client. mXml = null; mTheme = null; + mAssets = null; mResources.mTypedArrayPool.release(this); } |