From ae078778c8ed07f0489d18d937a8837593589b43 Mon Sep 17 00:00:00 2001 From: lumark Date: Tue, 19 Nov 2019 02:41:00 +0800 Subject: [PATCH] Fix animation when launching AppInfo in LiveTile task When enabling LiveTile, in overview screen, if launching AppInfo activity from LiveTile task, since the task view is not screenshot but is a reparented task surface by RecentsAnimation, so the wallpaper target will be recents, But because we ignored to upgrade wallpaper transition because the topClosingApp is not wallpaper target, it will cause launching AppInfo activity with TRANSIT_TASK_OPEN or TRANSIT_TASK_TO_FRONT instead of TRANSIT_WALLPAPER_CLOSE transition. The fix is to add a check in RecentsAnimationController#isWallpaperVisible to check if the live-tile task is in recents animation task and currently wallpaper is visible and live-tile is on-top of the recents. So that the topClocingApp and wallpaper target will be the live-tile task and can upgrade to wallpaper transition. Fix: 143775967 Test: manual in test steps: 1) long press launcher to launch menu -> Home setttings 2) Enable quick step live-tile. 3) Launch youtube 4) Swipe-up from navbar to launch recents and make sure yotube is still playing video. 5) Press youtube itcon on the task view and choose launch AppInfo 6) See if the animation is scaled-up from recents. (i.e.: TRANSIT_WALLPAPER_CLOSE transition) Change-Id: I3071ba7410f0c1b7ad98450a3d172e22c695c015 --- .../java/com/android/server/wm/AppTransitionController.java | 6 +++++- .../com/android/server/wm/RecentsAnimationController.java | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/services/core/java/com/android/server/wm/AppTransitionController.java b/services/core/java/com/android/server/wm/AppTransitionController.java index 0798a910c8608..78d2e423a914f 100644 --- a/services/core/java/com/android/server/wm/AppTransitionController.java +++ b/services/core/java/com/android/server/wm/AppTransitionController.java @@ -713,7 +713,11 @@ public class AppTransitionController { final WindowState wallpaperTarget = mWallpaperControllerLocked.getWallpaperTarget(); final boolean showWallpaper = wallpaperTarget != null - && (wallpaperTarget.mAttrs.flags & FLAG_SHOW_WALLPAPER) != 0; + && ((wallpaperTarget.mAttrs.flags & FLAG_SHOW_WALLPAPER) != 0 + // Update task open transition to wallpaper transition when wallpaper is visible. + // (i.e.launching app info activity from recent tasks) + || ((transit == TRANSIT_TASK_OPEN || transit == TRANSIT_TASK_TO_FRONT) + && mWallpaperControllerLocked.isWallpaperVisible())); // If wallpaper is animating or wallpaperTarget doesn't have SHOW_WALLPAPER flag set, // don't consider upgrading to wallpaper transition. final WindowState oldWallpaper = diff --git a/services/core/java/com/android/server/wm/RecentsAnimationController.java b/services/core/java/com/android/server/wm/RecentsAnimationController.java index da9d074eb7bc3..2000f14013b7a 100644 --- a/services/core/java/com/android/server/wm/RecentsAnimationController.java +++ b/services/core/java/com/android/server/wm/RecentsAnimationController.java @@ -743,8 +743,10 @@ public class RecentsAnimationController implements DeathRecipient { } boolean isWallpaperVisible(WindowState w) { - return w != null && w.mAttrs.type == TYPE_BASE_APPLICATION && w.mActivityRecord != null - && mTargetActivityRecord == w.mActivityRecord && isTargetOverWallpaper(); + return w != null && w.mAttrs.type == TYPE_BASE_APPLICATION && + ((w.mActivityRecord != null && mTargetActivityRecord == w.mActivityRecord) + || isAnimatingTask(w.getTask())) + && isTargetOverWallpaper(); } /**