Skip to content

Commit bb53dad

Browse files
committed
Remove overzealous mutate() sanity check in LayerDrawable
Child drawables of a LayerDrawable should be able to mutate() as a no-op even if they !canConstantState. Bug 7622311 Change-Id: I32c00961310f23aaf9ad868c419cbefb9d27a1d2
1 parent ba4ac51 commit bb53dad

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

graphics/java/android/graphics/drawable/LayerDrawable.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -575,10 +575,6 @@ public ConstantState getConstantState() {
575575
@Override
576576
public Drawable mutate() {
577577
if (!mMutated && super.mutate() == this) {
578-
if (!mLayerState.canConstantState()) {
579-
throw new IllegalStateException("One or more children of this LayerDrawable does " +
580-
"not have constant state; this drawable cannot be mutated.");
581-
}
582578
mLayerState = new LayerState(mLayerState, this, null);
583579
final ChildDrawable[] array = mLayerState.mChildren;
584580
final int N = mLayerState.mNum;

0 commit comments

Comments
 (0)