From d47ad033c35b2b69fc0be2073c682c30c855c124 Mon Sep 17 00:00:00 2001 From: Adrian Roos Date: Fri, 15 Aug 2014 23:17:05 +0200 Subject: [PATCH] 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 --- .../java/com/android/server/wm/WindowStateAnimator.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/services/core/java/com/android/server/wm/WindowStateAnimator.java b/services/core/java/com/android/server/wm/WindowStateAnimator.java index 61c50d67389a6..7bf090a35b993 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 @@ class WindowStateAnimator { || 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);