From e41034034f078583b9fffb4aeb776d93ae130b8a Mon Sep 17 00:00:00 2001 From: Cyrus Boadway Date: Wed, 5 May 2021 14:16:31 +0000 Subject: [PATCH] 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 --- .../android/quickstep/views/FloatingWidgetBackgroundView.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quickstep/src/com/android/quickstep/views/FloatingWidgetBackgroundView.java b/quickstep/src/com/android/quickstep/views/FloatingWidgetBackgroundView.java index f74aa55cbd..9ea2369836 100644 --- a/quickstep/src/com/android/quickstep/views/FloatingWidgetBackgroundView.java +++ b/quickstep/src/com/android/quickstep/views/FloatingWidgetBackgroundView.java @@ -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() {