From 8bbcf1392651cd08121ec9ae89684edec4df68aa Mon Sep 17 00:00:00 2001 From: wilsonshih Date: Fri, 4 Nov 2022 20:39:23 +0800 Subject: [PATCH] Fixes wallpaper's orientation mismatch the opening target. When showing back-predict animation, the wallpaper's orientation should match the opening target. Bug: 241808055 Bug: 254805643 Test: verify wallpaper's orientation should match the opening target, such as Launcher. Change-Id: If00ca3c55034e241096a308c0615451a4800735b --- .../com/android/server/wm/BackNavigationController.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/services/core/java/com/android/server/wm/BackNavigationController.java b/services/core/java/com/android/server/wm/BackNavigationController.java index 9398bbec4a63b..f5da4c80ba97c 100644 --- a/services/core/java/com/android/server/wm/BackNavigationController.java +++ b/services/core/java/com/android/server/wm/BackNavigationController.java @@ -19,6 +19,7 @@ package com.android.server.wm; import static android.view.RemoteAnimationTarget.MODE_CLOSING; import static android.view.RemoteAnimationTarget.MODE_OPENING; import static android.view.WindowManager.LayoutParams.INVALID_WINDOW_TYPE; +import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION; import static android.view.WindowManager.TRANSIT_CLOSE; import static android.view.WindowManager.TRANSIT_TO_BACK; @@ -831,9 +832,8 @@ class BackNavigationController { } boolean isWallpaperVisible(WindowState w) { - if (mBackAnimationInProgress && w.isFocused()) { - return mShowWallpaper; - } - return false; + return mAnimationTargets.mComposed && mShowWallpaper + && w.mAttrs.type == TYPE_BASE_APPLICATION && w.mActivityRecord != null + && mAnimationTargets.isTarget(w.mActivityRecord, true /* open */); } }