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
This commit is contained in:
Jorim Jaggi
2016-05-17 14:35:42 -07:00
parent 8ab4d2c0b4
commit ca0cf0f529

View File

@@ -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;
}