diff --git a/core/java/android/view/animation/Animation.java b/core/java/android/view/animation/Animation.java
index 474db128fcc3fe641560ec3a10316be245b93561..64686dd977a2adf5737ea24d29110d4e96558e63 100644
--- a/core/java/android/view/animation/Animation.java
+++ b/core/java/android/view/animation/Animation.java
@@ -206,6 +206,8 @@ public abstract class Animation implements Cloneable {
*/
private boolean mDetachWallpaper = false;
+ private boolean mShowWallpaper;
+
private boolean mMore = true;
private boolean mOneMoreTime = true;
@@ -253,7 +255,10 @@ public abstract class Animation implements Cloneable {
setBackgroundColor(a.getInt(com.android.internal.R.styleable.Animation_background, 0));
- setDetachWallpaper(a.getBoolean(com.android.internal.R.styleable.Animation_detachWallpaper, false));
+ setDetachWallpaper(
+ a.getBoolean(com.android.internal.R.styleable.Animation_detachWallpaper, false));
+ setShowWallpaper(
+ a.getBoolean(com.android.internal.R.styleable.Animation_showWallpaper, false));
final int resID = a.getResourceId(com.android.internal.R.styleable.Animation_interpolator, 0);
@@ -660,6 +665,18 @@ public abstract class Animation implements Cloneable {
mDetachWallpaper = detachWallpaper;
}
+ /**
+ * If this animation is run as a window animation, this will make the wallpaper visible behind
+ * the animation.
+ *
+ * @param showWallpaper Whether the wallpaper should be shown during the animation.
+ * @attr ref android.R.styleable#Animation_detachWallpaper
+ * @hide
+ */
+ public void setShowWallpaper(boolean showWallpaper) {
+ mShowWallpaper = showWallpaper;
+ }
+
/**
* Gets the acceleration curve type for this animation.
*
@@ -774,6 +791,16 @@ public abstract class Animation implements Cloneable {
return mDetachWallpaper;
}
+ /**
+ * @return If run as a window animation, returns whether the wallpaper will be shown behind
+ * during the animation.
+ * @attr ref android.R.styleable#Animation_showWallpaper
+ * @hide
+ */
+ public boolean getShowWallpaper() {
+ return mShowWallpaper;
+ }
+
/**
*
Indicates whether or not this animation will affect the transformation
* matrix. For instance, a fade animation will not affect the matrix whereas
diff --git a/core/res/res/anim/task_close_enter.xml b/core/res/res/anim/task_close_enter.xml
index 81d1300038e3939759cab90e00b4190ec1aa9631..c298b8090a01cdbe2035efab1daded751d2b771a 100644
--- a/core/res/res/anim/task_close_enter.xml
+++ b/core/res/res/anim/task_close_enter.xml
@@ -17,7 +17,8 @@
-->
+ android:zAdjustment="top"
+ android:showWallpaper="true">
+ android:shareInterpolator="false"
+ android:showWallpaper="true">
+ android:zAdjustment="top"
+ android:showWallpaper="true">
+ android:zAdjustment="top"
+ android:showWallpaper="true">
+ android:shareInterpolator="false"
+ android:showWallpaper="true">
+
+
diff --git a/services/core/java/com/android/server/wm/AnimationAdapter.java b/services/core/java/com/android/server/wm/AnimationAdapter.java
index ed4543ef82feb91b369ff451a37d79a54b202061..64f77a2cc4ce71a24d3e88e0b272181893f37d88 100644
--- a/services/core/java/com/android/server/wm/AnimationAdapter.java
+++ b/services/core/java/com/android/server/wm/AnimationAdapter.java
@@ -38,6 +38,12 @@ interface AnimationAdapter {
*/
boolean getDetachWallpaper();
+ /**
+ * @return Whether we should show the wallpaper during the animation.
+ * @see Animation#getShowWallpaper()
+ */
+ boolean getShowWallpaper();
+
/**
* @return The background color behind the animation.
*/
diff --git a/services/core/java/com/android/server/wm/AppWindowToken.java b/services/core/java/com/android/server/wm/AppWindowToken.java
index 8155656cd5f4f3885e863490d67f50bd7de4c72b..20bcd2d8194b1bb0314fc97440316b934554871a 100644
--- a/services/core/java/com/android/server/wm/AppWindowToken.java
+++ b/services/core/java/com/android/server/wm/AppWindowToken.java
@@ -1668,6 +1668,9 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
}
if (adapter != null) {
startAnimation(getPendingTransaction(), adapter, !isVisible());
+ if (adapter.getShowWallpaper()) {
+ mDisplayContent.pendingLayoutChanges |= FINISH_LAYOUT_REDO_WALLPAPER;
+ }
}
} else {
cancelAnimation();
diff --git a/services/core/java/com/android/server/wm/LocalAnimationAdapter.java b/services/core/java/com/android/server/wm/LocalAnimationAdapter.java
index 2173fa3a283d1741b0c139e6ad44652273790ebf..1b41cb84516d606710856fccf91bd7a4a9c17b5e 100644
--- a/services/core/java/com/android/server/wm/LocalAnimationAdapter.java
+++ b/services/core/java/com/android/server/wm/LocalAnimationAdapter.java
@@ -42,6 +42,11 @@ class LocalAnimationAdapter implements AnimationAdapter {
return mSpec.getDetachWallpaper();
}
+ @Override
+ public boolean getShowWallpaper() {
+ return mSpec.getShowWallpaper();
+ }
+
@Override
public int getBackgroundColor() {
return mSpec.getBackgroundColor();
@@ -81,6 +86,13 @@ class LocalAnimationAdapter implements AnimationAdapter {
return false;
}
+ /**
+ * @see AnimationAdapter#getShowWallpaper
+ */
+ default boolean getShowWallpaper() {
+ return false;
+ }
+
/**
* @see AnimationAdapter#getBackgroundColor
*/
diff --git a/services/core/java/com/android/server/wm/RecentsAnimationController.java b/services/core/java/com/android/server/wm/RecentsAnimationController.java
index 78dd580259a03767a14824eab4e0715e5469cb6b..31b5c698dc5e9636e5f4bb16998ea8e42554dc01 100644
--- a/services/core/java/com/android/server/wm/RecentsAnimationController.java
+++ b/services/core/java/com/android/server/wm/RecentsAnimationController.java
@@ -367,6 +367,11 @@ public class RecentsAnimationController {
return false;
}
+ @Override
+ public boolean getShowWallpaper() {
+ return false;
+ }
+
@Override
public int getBackgroundColor() {
return 0;
diff --git a/services/core/java/com/android/server/wm/RemoteAnimationController.java b/services/core/java/com/android/server/wm/RemoteAnimationController.java
index 35fc99fe46122924914a250be4438129e591e6d0..ed6e606b0c755edf970d4b8cd913a705b889949d 100644
--- a/services/core/java/com/android/server/wm/RemoteAnimationController.java
+++ b/services/core/java/com/android/server/wm/RemoteAnimationController.java
@@ -220,6 +220,11 @@ class RemoteAnimationController {
return false;
}
+ @Override
+ public boolean getShowWallpaper() {
+ return false;
+ }
+
@Override
public int getBackgroundColor() {
return 0;
diff --git a/services/core/java/com/android/server/wm/RootWindowContainer.java b/services/core/java/com/android/server/wm/RootWindowContainer.java
index a4f20b012576f170693e3a6c1b02297fc1807b33..6356a3512e65c541cfb85e4bf03bcbb9708d2f74 100644
--- a/services/core/java/com/android/server/wm/RootWindowContainer.java
+++ b/services/core/java/com/android/server/wm/RootWindowContainer.java
@@ -606,8 +606,11 @@ class RootWindowContainer extends WindowContainer {
// If we are ready to perform an app transition, check through all of the app tokens to be
// shown and see if they are ready to go.
if (mService.mAppTransition.isReady()) {
- defaultDisplay.pendingLayoutChanges |=
- surfacePlacer.handleAppTransitionReadyLocked();
+ // This needs to be split into two expressions, as handleAppTransitionReadyLocked may
+ // modify dc.pendingLayoutChanges, which would get lost when writing
+ // defaultDisplay.pendingLayoutChanges |= handleAppTransitionReadyLocked()
+ final int layoutChanges = surfacePlacer.handleAppTransitionReadyLocked();
+ defaultDisplay.pendingLayoutChanges |= layoutChanges;
if (DEBUG_LAYOUT_REPEATS)
surfacePlacer.debugLayoutRepeats("after handleAppTransitionReadyLocked",
defaultDisplay.pendingLayoutChanges);
diff --git a/services/core/java/com/android/server/wm/WallpaperController.java b/services/core/java/com/android/server/wm/WallpaperController.java
index f2ad6fb7a888087f834c4a97e82ae2fb0c004ddc..a7d51f175ab55c9598a0191b63cede034d6bda55 100644
--- a/services/core/java/com/android/server/wm/WallpaperController.java
+++ b/services/core/java/com/android/server/wm/WallpaperController.java
@@ -151,7 +151,10 @@ class WallpaperController {
final RecentsAnimationController recentsAnimationController =
mService.getRecentsAnimationController();
- final boolean hasWallpaper = (w.mAttrs.flags & FLAG_SHOW_WALLPAPER) != 0;
+ final boolean animationWallpaper = w.mAppToken != null && w.mAppToken.getAnimation() != null
+ && w.mAppToken.getAnimation().getShowWallpaper();
+ final boolean hasWallpaper = (w.mAttrs.flags & FLAG_SHOW_WALLPAPER) != 0
+ || animationWallpaper;
final boolean isRecentsTransitionTarget = (recentsAnimationController != null
&& recentsAnimationController.isWallpaperVisible(w));
if (isRecentsTransitionTarget) {
diff --git a/services/core/java/com/android/server/wm/WindowAnimationSpec.java b/services/core/java/com/android/server/wm/WindowAnimationSpec.java
index 0863ee9eebb37b9d66ba2141bbb0fe45ce414ddc..43fa3d56914e1e43c27c307bac1e49204342b187 100644
--- a/services/core/java/com/android/server/wm/WindowAnimationSpec.java
+++ b/services/core/java/com/android/server/wm/WindowAnimationSpec.java
@@ -68,6 +68,11 @@ public class WindowAnimationSpec implements AnimationSpec {
return mAnimation.getDetachWallpaper();
}
+ @Override
+ public boolean getShowWallpaper() {
+ return mAnimation.getShowWallpaper();
+ }
+
@Override
public int getBackgroundColor() {
return mAnimation.getBackgroundColor();