From 014e14b242848eaa86a10562e1c494143a0149aa Mon Sep 17 00:00:00 2001 From: Chet Haase Date: Tue, 2 Sep 2014 16:11:26 -0700 Subject: Fix behavior of inflating InsetDrawable A recent change to InsetDrawable changed the behavior of inflating an InsetDrawable when it already had a valid bitmap. The new behavior avoids throwing an exception with a bad resource where it used to throw, because the existence of the bitmap makes it avoid trying to load the resource at all. The fix is to reintroduce the old behavior of forcing it to load the resource regardless of the state of its bitmap. Issue #17068252 InsetDrawable inflation CTS test is failing Change-Id: I941388730d4479f8f4747a7985754ffdf5133f04 --- graphics/java/android/graphics/drawable/InsetDrawable.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'graphics/java') diff --git a/graphics/java/android/graphics/drawable/InsetDrawable.java b/graphics/java/android/graphics/drawable/InsetDrawable.java index a20b6d8f0d88..384226fcc72a 100644 --- a/graphics/java/android/graphics/drawable/InsetDrawable.java +++ b/graphics/java/android/graphics/drawable/InsetDrawable.java @@ -86,6 +86,8 @@ public class InsetDrawable extends Drawable implements Drawable.Callback { throws XmlPullParserException, IOException { final TypedArray a = r.obtainAttributes(attrs, R.styleable.InsetDrawable); super.inflateWithAttributes(r, parser, a, R.styleable.InsetDrawable_visible); + + mInsetState.mDrawable = null; updateStateFromTypedArray(a); // Load inner XML elements. -- cgit v1.2.3-59-g8ed1b