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

Commit ca0cf0f5 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Fix threading problems with drawables

We can't use the same instance on both the main and the background
thread, as this will lead to problems.

Change-Id: Ieec525f028df2d0596667126d8f5004773461517
Fixes: 28745682
parent 8ab4d2c0
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -109,9 +109,15 @@ public class BackdropFrameRenderer extends Thread implements Choreographer.Frame
            Drawable captionBackgroundDrawableDrawable, Drawable userCaptionBackgroundDrawable,
            int statusBarColor, int navigationBarColor) {
        mDecorView = decorView;
        mResizingBackgroundDrawable = resizingBackgroundDrawable;
        mCaptionBackgroundDrawable = captionBackgroundDrawableDrawable;
        mUserCaptionBackgroundDrawable = userCaptionBackgroundDrawable;
        mResizingBackgroundDrawable = resizingBackgroundDrawable != null
                ? resizingBackgroundDrawable.getConstantState().newDrawable()
                : null;
        mCaptionBackgroundDrawable = captionBackgroundDrawableDrawable != null
                ? captionBackgroundDrawableDrawable.getConstantState().newDrawable()
                : null;
        mUserCaptionBackgroundDrawable = userCaptionBackgroundDrawable != null
                ? userCaptionBackgroundDrawable.getConstantState().newDrawable()
                : null;
        if (mCaptionBackgroundDrawable == null) {
            mCaptionBackgroundDrawable = mResizingBackgroundDrawable;
        }