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

Commit 76afd1f1 authored by Adam Lesinski's avatar Adam Lesinski
Browse files

Improve Jank for translucent activities

The previous jank improvement only worked when closing
an app, not when bringing one forward (hitting home button).
This should cover the specific case that is being missed: Having the
Home task being brought to front over a translucent window, with
a wallpaper behind both tasks.

bug:11253262
Change-Id: I200ef6fe2dda8d9ab4e1f82059b4f888c59007f4
parent 3e1a9eac
Loading
Loading
Loading
Loading
+3 −17
Original line number Diff line number Diff line
@@ -8434,20 +8434,6 @@ public class WindowManagerService extends IWindowManager.Stub
                        && !mWallpaperTarget.mWinAnimator.isDummyAnimation()
                    ? null : mWallpaperTarget;

            // If there is a wallpaper target and the target is neither opening nor closing, then
            // there exists an app on top of the wallpaper target that has a translucent
            // background.
            // If the pending transition is an exit, we should add the wallpaper target to the list
            // of opening apps so that the translucent app on top of it will animate correctly.
            final AppWindowToken wallpaperTargetAppToken =
                    mWallpaperTarget != null ? mWallpaperTarget.mAppToken : null;
            if (wallpaperTargetAppToken != null
                    && !mClosingApps.contains(wallpaperTargetAppToken)
                    && !mOpeningApps.contains(wallpaperTargetAppToken)
                    && (transit & AppTransition.TRANSIT_EXIT_MASK) != 0) {
                mOpeningApps.add(wallpaperTargetAppToken);
                NN++;
            }
            mInnerFields.mWallpaperMayChange = false;

            // The top-most window will supply the layout params,
@@ -8533,7 +8519,8 @@ public class WindowManagerService extends IWindowManager.Stub
                        break;
                }
                if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "New transit: " + transit);
            } else if ((oldWallpaper != null) && !mOpeningApps.contains(oldWallpaper.mAppToken)) {
            } else if ((oldWallpaper != null) && !mOpeningApps.isEmpty()
                    && !mOpeningApps.contains(oldWallpaper.mAppToken)) {
                // We are transitioning from an activity with
                // a wallpaper to one without.
                transit = AppTransition.TRANSIT_WALLPAPER_CLOSE;
@@ -8602,8 +8589,7 @@ public class WindowManagerService extends IWindowManager.Stub
                wtoken.mAppAnimator.clearThumbnail();
                wtoken.inPendingTransaction = false;
                wtoken.mAppAnimator.animation = null;
                setTokenVisibilityLocked(wtoken, animLp, false,
                        transit, false);
                setTokenVisibilityLocked(wtoken, animLp, false, transit, false);
                wtoken.updateReportedVisibilityLocked();
                wtoken.waitingToHide = false;
                // Force the allDrawn flag, because we want to start