Fix jank for translucent window transitions

When a translucent window is closing, the transition
animation to Launcher is janky because Launcher is
expected to be 'opening' but it has always been open
underneath the translucent window. Therefore, the
animation applied to the translucent app appears
janky.

bug:11253262
Change-Id: I9b6af3291d119e6927401f63785b12f25573f4eb
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index 00a653b..ea81681 100644
--- a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -8407,6 +8407,20 @@
                         && !mWallpaperTarget.mWinAnimator.isDummyAnimation()
                     ? null : mWallpaperTarget;
 
+            // If there is a wallpaper target and the target is neither opening nor closing, then
+            // there exists an app on top of the wallpaper target that has a translucent
+            // background.
+            // If the pending transition is an exit, we should add the wallpaper target to the list
+            // of opening apps so that the translucent app on top of it will animate correctly.
+            final AppWindowToken wallpaperTargetAppToken =
+                    mWallpaperTarget != null ? mWallpaperTarget.mAppToken : null;
+            if (wallpaperTargetAppToken != null
+                    && !mClosingApps.contains(wallpaperTargetAppToken)
+                    && !mOpeningApps.contains(wallpaperTargetAppToken)
+                    && (transit & AppTransition.TRANSIT_EXIT_MASK) != 0) {
+                mOpeningApps.add(wallpaperTargetAppToken);
+                NN++;
+            }
             mInnerFields.mWallpaperMayChange = false;
 
             // The top-most window will supply the layout params,