Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6968aa8e authored by Linnan Li's avatar Linnan Li
Browse files

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
parent 219a0d17
Loading
Loading
Loading
Loading
+10 −1
Original line number Original line Diff line number Diff line
@@ -1337,7 +1337,16 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
        // Commit wallpaper visibility after activity, because usually the wallpaper target token is
        // Commit wallpaper visibility after activity, because usually the wallpaper target token is
        // an activity, and wallpaper's visibility depends on activity's visibility.
        // an activity, and wallpaper's visibility depends on activity's visibility.
        for (int i = mParticipants.size() - 1; i >= 0; --i) {
        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;
            if (wt == null) continue;
            final WindowState target = wt.mDisplayContent.mWallpaperController.getWallpaperTarget();
            final WindowState target = wt.mDisplayContent.mWallpaperController.getWallpaperTarget();
            final boolean isTargetInvisible = target == null || !target.mToken.isVisible();
            final boolean isTargetInvisible = target == null || !target.mToken.isVisible();