Fix bars jumping to black on activity launch
During animations, the wallpaper crop is the
union of the start and end crop. This prevents
the system bars from jumping to black when an
activity with opaque bars is launched.
Bug: 16441036
Change-Id: Ic0f3bc2e83b9830514a3456a27ae6f23716f3240
diff --git a/services/core/java/com/android/server/wm/WindowStateAnimator.java b/services/core/java/com/android/server/wm/WindowStateAnimator.java
index 61c50d67..7bf090a 100644
--- a/services/core/java/com/android/server/wm/WindowStateAnimator.java
+++ b/services/core/java/com/android/server/wm/WindowStateAnimator.java
@@ -1211,6 +1211,12 @@
|| w.mDecorFrame.isEmpty()) {
// The universe background isn't cropped, nor windows without policy decor.
w.mSystemDecorRect.set(0, 0, w.mCompatFrame.width(), w.mCompatFrame.height());
+ } else if (w.mAttrs.type == LayoutParams.TYPE_WALLPAPER && mAnimator.mAnimating) {
+ // If we're animating, the wallpaper crop should only be updated at the end of the
+ // animation.
+ mTmpClipRect.set(w.mSystemDecorRect);
+ applyDecorRect(w.mDecorFrame);
+ w.mSystemDecorRect.union(mTmpClipRect);
} else {
// Crop to the system decor specified by policy.
applyDecorRect(w.mDecorFrame);