diff options
| author | 2024-12-02 08:33:54 +0000 | |
|---|---|---|
| committer | 2024-12-03 09:23:17 +0000 | |
| commit | 6968aa8eb87abc172d8f799eedaf71f21b6cfbe6 (patch) | |
| tree | 29c5287a74a75bb777b193204f8382375f2a1d3b | |
| parent | 219a0d17e88ebb5a55025994c88fd05440cb7245 (diff) | |
Fix the wallpaper not hiding immediately
When the application switches to the foreground, the wallpaper should
immediately hide after the shell transition ends. However, the current
issue arises because we are collecting the wallpaper target as
WindowState instead of its corresponding token, which causes the hiding
operation to be delayed.
To address this, we can add some checks: if the target is WindowState,
we will attempt to convert its token to WallpaperWindowToken in order
to resolve this issue.
Bug: 381804828
Test: Manual
Flag: EXEMPT bugfix
Change-Id: I5679a759811b7acb44909d840579fd7fb291412d
| -rw-r--r-- | services/core/java/com/android/server/wm/Transition.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/wm/Transition.java b/services/core/java/com/android/server/wm/Transition.java index 84df11a2746b..9ff9e348af77 100644 --- a/services/core/java/com/android/server/wm/Transition.java +++ b/services/core/java/com/android/server/wm/Transition.java @@ -1337,7 +1337,16 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener { // Commit wallpaper visibility after activity, because usually the wallpaper target token is // an activity, and wallpaper's visibility depends on activity's visibility. for (int i = mParticipants.size() - 1; i >= 0; --i) { - final WallpaperWindowToken wt = mParticipants.valueAt(i).asWallpaperToken(); + final WindowContainer<?> wc = mParticipants.valueAt(i); + WallpaperWindowToken wt = wc.asWallpaperToken(); + if (!Flags.ensureWallpaperInTransitions()) { + if (wt == null) { + final WindowState windowState = wc.asWindowState(); + if (windowState != null) { + wt = windowState.mToken.asWallpaperToken(); + } + } + } if (wt == null) continue; final WindowState target = wt.mDisplayContent.mWallpaperController.getWallpaperTarget(); final boolean isTargetInvisible = target == null || !target.mToken.isVisible(); |