Fix FloatingWidgetView post-animation fallback background handling

The background drawables should only be restored to the original view if
the values are non-null. The original view may have had a background drawable
be a drawable, just not one that's elligible for animation. In that
case the local reference is null. We should not restore that.

Bug: 169042867
Test: manual
Change-Id: I54eaac5632e3f4f25daee2c36d7609e8b2ffedaf
This commit is contained in:
Cyrus Boadway 2021-05-05 14:16:31 +00:00
parent e80a0caa81
commit e41034034f
1 changed files with 2 additions and 2 deletions

View File

@ -100,8 +100,8 @@ final class FloatingWidgetBackgroundView extends View {
/** Restores the drawables to the source view. */
void finish() {
if (isUninitialized()) return;
mSourceView.setForeground(mOriginalForeground);
mSourceView.setBackground(mOriginalBackground);
if (mOriginalForeground != null) mSourceView.setForeground(mOriginalForeground);
if (mOriginalBackground != null) mSourceView.setBackground(mOriginalBackground);
}
void recycle() {