am be6024d5: Merge "Fix crash in ShapeDrawable" into jb-mr1-dev

* commit 'be6024d57140a81883e6c5a27cae56a7d31d10dc':
  Fix crash in ShapeDrawable
This commit is contained in:
Romain Guy
2012-09-07 18:41:34 -07:00
committed by Android Git Automerger

View File

@@ -373,8 +373,16 @@ public class ShapeDrawable extends Drawable {
@Override
public Drawable mutate() {
if (!mMutated && super.mutate() == this) {
mShapeState.mPaint = new Paint(mShapeState.mPaint);
mShapeState.mPadding = new Rect(mShapeState.mPadding);
if (mShapeState.mPaint != null) {
mShapeState.mPaint = new Paint(mShapeState.mPaint);
} else {
mShapeState.mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
}
if (mShapeState.mPadding != null) {
mShapeState.mPadding = new Rect(mShapeState.mPadding);
} else {
mShapeState.mPadding = new Rect();
}
try {
mShapeState.mShape = mShapeState.mShape.clone();
} catch (CloneNotSupportedException e) {