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

Commit 798adeff authored by Craig Mautner's avatar Craig Mautner
Browse files

Don't use transient states for wallpaper animation.

The WindowManagerService member mLowerWallpaperTarget is not stable
throughout an app transition. Relying on it to be stable causes the
intra-wallpaper animation to start out right but after the windows
have been relayed out there is no longer a lower wallpaper target.
This causes the wallpaper to start tracking the animation of the
current wallpaper target rather than remain stable.

Switching to a new variable that saves the state of wallpaper
animation at the start of the animation fixes bug 11240590.

Change-Id: I336a59c47665fcf61019f567b8663956ff0e4940
parent 40006309
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -121,12 +121,6 @@ public class WindowAnimator {
        mDisplayContentsAnimators.delete(displayId);
    }

    AppWindowAnimator getWallpaperAppAnimator() {
        return mService.mWallpaperTarget == null
                ? null : mService.mWallpaperTarget.mAppToken == null
                        ? null : mService.mWallpaperTarget.mAppToken.mAppAnimator;
    }

    void hideWallpapersLocked(final WindowState w) {
        final WindowState wallpaperTarget = mService.mWallpaperTarget;
        final WindowState lowerWallpaperTarget = mService.mLowerWallpaperTarget;
+4 −0
Original line number Diff line number Diff line
@@ -530,6 +530,7 @@ public class WindowManagerService extends IWindowManager.Stub
    static final long WALLPAPER_TIMEOUT = 150;
    // Time we wait after a timeout before trying to wait again.
    static final long WALLPAPER_TIMEOUT_RECOVERY = 10000;
    boolean mAnimateWallpaperWithTarget;

    AppWindowToken mFocusedApp = null;

@@ -8490,6 +8491,7 @@ public class WindowManagerService extends IWindowManager.Stub
                }
            }

            mAnimateWallpaperWithTarget = false;
            if (closingAppHasWallpaper && openingAppHasWallpaper) {
                if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "Wallpaper animation!");
                switch (transit) {
@@ -8517,6 +8519,8 @@ public class WindowManagerService extends IWindowManager.Stub
                transit = AppTransition.TRANSIT_WALLPAPER_OPEN;
                if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,
                        "New transit into wallpaper: " + transit);
            } else {
                mAnimateWallpaperWithTarget = true;
            }

            // If all closing windows are obscured, then there is
+6 −5
Original line number Diff line number Diff line
@@ -845,9 +845,9 @@ class WindowStateAnimator {

        // Wallpapers are animated based on the "real" window they
        // are currently targeting.
        if (mIsWallpaper && mService.mLowerWallpaperTarget == null
                && mService.mWallpaperTarget != null) {
            final WindowStateAnimator wallpaperAnimator = mService.mWallpaperTarget.mWinAnimator;
        final WindowState wallpaperTarget = mService.mWallpaperTarget;
        if (mIsWallpaper && wallpaperTarget != null && mService.mAnimateWallpaperWithTarget) {
            final WindowStateAnimator wallpaperAnimator = wallpaperTarget.mWinAnimator;
            if (wallpaperAnimator.mHasLocalTransformation &&
                    wallpaperAnimator.mAnimation != null &&
                    !wallpaperAnimator.mAnimation.getDetachWallpaper()) {
@@ -856,7 +856,8 @@ class WindowStateAnimator {
                    Slog.v(TAG, "WP target attached xform: " + attachedTransformation);
                }
            }
            final AppWindowAnimator wpAppAnimator = mAnimator.getWallpaperAppAnimator();
            final AppWindowAnimator wpAppAnimator = wallpaperTarget.mAppToken == null ?
                    null : wallpaperTarget.mAppToken.mAppAnimator;
                if (wpAppAnimator != null && wpAppAnimator.hasTransformation
                    && wpAppAnimator.animation != null
                    && !wpAppAnimator.animation.getDetachWallpaper()) {