Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a525f0db authored by Nader Jawad's avatar Nader Jawad Committed by android-build-merger
Browse files

Merge "Added null checks to LayerDrawable implementation" into qt-dev am: 6e4e9817 am: a0cd0bb7

am: dff4367b

Change-Id: If57d37339fda289c002d154bdf8f3414045ac5e7
parents 441200fc dff4367b
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -139,9 +139,12 @@ public class LayerDrawable extends Drawable implements Drawable.Callback {
        final ChildDrawable[] r = new ChildDrawable[length];
        for (int i = 0; i < length; i++) {
            r[i] = new ChildDrawable(mLayerState.mDensity);
            r[i].mDrawable = layers[i];
            layers[i].setCallback(this);
            mLayerState.mChildrenChangingConfigurations |= layers[i].getChangingConfigurations();
            Drawable child = layers[i];
            r[i].mDrawable = child;
            if (child != null) {
                child.setCallback(this);
                mLayerState.mChildrenChangingConfigurations |= child.getChangingConfigurations();
            }
        }
        mLayerState.mNumChildren = length;
        mLayerState.mChildren = r;
@@ -416,7 +419,8 @@ public class LayerDrawable extends Drawable implements Drawable.Callback {
        final ChildDrawable[] layers = mLayerState.mChildren;
        final int N = mLayerState.mNumChildren;
        for (int i = 0; i < N; i++) {
            if (layers[i].mDrawable.isProjected()) {
            Drawable childDrawable = layers[i].mDrawable;
            if (childDrawable != null && childDrawable.isProjected()) {
                return true;
            }
        }