From ff3428b1baae998ca6dbeef85cf9dfce8cecb2e4 Mon Sep 17 00:00:00 2001 From: Chris Li Date: Wed, 7 Dec 2022 21:01:06 +0800 Subject: [PATCH] Fix customized activity open/close animation backdrop color Before, we always read the next app requested color. Now, we read the backdrop color from next app requested animation, which is the requested color if set, or the color in the animation XML if there is no override color. Bug: 241043533 Test: verify with resource color Change-Id: I0687078a1cbcb46e71ab269059911072eb7046fd --- .../core/java/com/android/server/wm/WindowContainer.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/wm/WindowContainer.java b/services/core/java/com/android/server/wm/WindowContainer.java index 0b80914272dd0..4c8095e285181 100644 --- a/services/core/java/com/android/server/wm/WindowContainer.java +++ b/services/core/java/com/android/server/wm/WindowContainer.java @@ -3011,13 +3011,16 @@ class WindowContainer extends ConfigurationContainer< // When there are more than one changing containers, it may leave part of the // screen empty. Show background color to cover that. showBackdrop = getDisplayContent().mChangingContainers.size() > 1; + backdropColor = appTransition.getNextAppTransitionBackgroundColor(); } else { // Check whether the app has requested to show backdrop for open/close // transition. final Animation a = appTransition.getNextAppRequestedAnimation(enter); - showBackdrop = a != null && a.getShowBackdrop(); + if (a != null) { + showBackdrop = a.getShowBackdrop(); + backdropColor = a.getBackdropColor(); + } } - backdropColor = appTransition.getNextAppTransitionBackgroundColor(); } final Rect localBounds = new Rect(mTmpRect); localBounds.offsetTo(mTmpPoint.x, mTmpPoint.y);