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

Commit 0fd2574a authored by Chong Zhang's avatar Chong Zhang
Browse files

Do not draw background if the background drawable is null

Some apps may not have background drawables.

bug: 26729953
Change-Id: I1e93013bb91ba376449bc580646fc733ca4dd072
parent 84867864
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -289,12 +289,17 @@ public class BackdropFrameRenderer extends Thread implements Choreographer.Frame
        DisplayListCanvas canvas = mFrameAndBackdropNode.start(width, height);
        final Drawable drawable = mUserCaptionBackgroundDrawable != null
                ? mUserCaptionBackgroundDrawable : mCaptionBackgroundDrawable;

        if (drawable != null) {
            drawable.setBounds(0, 0, left + width, top + mLastCaptionHeight);
            drawable.draw(canvas);
        }

        // The backdrop: clear everything with the background. Clipping is done elsewhere.
        if (mResizingBackgroundDrawable != null) {
            mResizingBackgroundDrawable.setBounds(0, mLastCaptionHeight, left + width, top + height);
            mResizingBackgroundDrawable.draw(canvas);
        }
        mFrameAndBackdropNode.end(canvas);

        if (mSystemBarBackgroundNode != null && mStatusBarColor != null) {