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

Commit 92d091da authored by Chong Zhang's avatar Chong Zhang Committed by Android (Google) Code Review
Browse files

Merge "resolve merge conflicts of 28117e06 to master"

parents 2d280471 4d263be0
Loading
Loading
Loading
Loading
+13 −4
Original line number Original line Diff line number Diff line
@@ -498,6 +498,7 @@ class AppWindowToken extends WindowToken {
    }
    }


    void clearAnimatingFlags() {
    void clearAnimatingFlags() {
        boolean wallpaperMightChange = false;
        for (int i = windows.size() - 1; i >= 0; i--) {
        for (int i = windows.size() - 1; i >= 0; i--) {
            final WindowState win = windows.get(i);
            final WindowState win = windows.get(i);
            // We don't want to clear it out for windows that get replaced, because the
            // We don't want to clear it out for windows that get replaced, because the
@@ -508,7 +509,6 @@ class AppWindowToken extends WindowToken {
            // by the client. We should let animation proceed and not clear this flag or
            // by the client. We should let animation proceed and not clear this flag or
            // they won't eventually be removed by WindowStateAnimator#finishExit.
            // they won't eventually be removed by WindowStateAnimator#finishExit.
            if (!win.mWillReplaceWindow && !win.mRemoveOnExit) {
            if (!win.mWillReplaceWindow && !win.mRemoveOnExit) {
                win.mAnimatingExit = false;
                // Clear mAnimating flag together with mAnimatingExit. When animation
                // Clear mAnimating flag together with mAnimatingExit. When animation
                // changes from exiting to entering, we need to clear this flag until the
                // changes from exiting to entering, we need to clear this flag until the
                // new animation gets applied, so that isAnimationStarting() becomes true
                // new animation gets applied, so that isAnimationStarting() becomes true
@@ -516,16 +516,25 @@ class AppWindowToken extends WindowToken {
                // Otherwise applySurfaceChangesTransaction will faill to skip surface
                // Otherwise applySurfaceChangesTransaction will faill to skip surface
                // placement for this window during this period, one or more frame will
                // placement for this window during this period, one or more frame will
                // show up with wrong position or scale.
                // show up with wrong position or scale.
                if (win.mAnimatingExit) {
                    win.mAnimatingExit = false;
                    wallpaperMightChange = true;
                }
                if (win.mWinAnimator.mAnimating) {
                    win.mWinAnimator.mAnimating = false;
                    win.mWinAnimator.mAnimating = false;

                    wallpaperMightChange = true;
                }
                if (win.mDestroying) {
                if (win.mDestroying) {
                    win.mDestroying = false;
                    win.mDestroying = false;
                    mService.mDestroySurface.remove(win);
                    mService.mDestroySurface.remove(win);
                    wallpaperMightChange = true;
                }
                }
            }
            }
        }
        }
        if (wallpaperMightChange) {
            requestUpdateWallpaperIfNeeded();
            requestUpdateWallpaperIfNeeded();
        }
        }
    }


    void destroySurfaces() {
    void destroySurfaces() {
        destroySurfaces(false /*cleanupOnResume*/);
        destroySurfaces(false /*cleanupOnResume*/);
+21 −9
Original line number Original line Diff line number Diff line
@@ -508,9 +508,14 @@ class WallpaperController {
                    if (DEBUG_WALLPAPER_LIGHT) Slog.v(TAG,
                    if (DEBUG_WALLPAPER_LIGHT) Slog.v(TAG,
                            "New i: " + wallpaperTargetIndex + " old i: " + oldI);
                            "New i: " + wallpaperTargetIndex + " old i: " + oldI);
                    if (oldI >= 0) {
                    if (oldI >= 0) {
                        if (DEBUG_WALLPAPER_LIGHT) Slog.v(TAG,
                        final boolean newTargetHidden =
                                "Animating wallpapers: old#" + oldI + "=" + oldW + "; new#"
                                wallpaperTarget.mAppToken != null && wallpaperTarget.mAppToken.hiddenRequested;
                                + wallpaperTargetIndex + "=" + wallpaperTarget);
                        final boolean oldTargetHidden =
                                oldW.mAppToken != null && oldW.mAppToken.hiddenRequested;
                        if (DEBUG_WALLPAPER_LIGHT) Slog.v(TAG, "Animating wallpapers:"
                                + " old#" + oldI + "=" + oldW + " hidden=" + oldTargetHidden
                                + " new#" + wallpaperTargetIndex + "=" + wallpaperTarget
                                + " hidden=" + newTargetHidden);


                        // Set the upper and lower wallpaper targets correctly,
                        // Set the upper and lower wallpaper targets correctly,
                        // and make sure that we are positioning the wallpaper below the lower.
                        // and make sure that we are positioning the wallpaper below the lower.
@@ -520,6 +525,7 @@ class WallpaperController {
                                    "Found target above old target.");
                                    "Found target above old target.");
                            mUpperWallpaperTarget = wallpaperTarget;
                            mUpperWallpaperTarget = wallpaperTarget;
                            mLowerWallpaperTarget = oldW;
                            mLowerWallpaperTarget = oldW;

                            wallpaperTarget = oldW;
                            wallpaperTarget = oldW;
                            wallpaperTargetIndex = oldI;
                            wallpaperTargetIndex = oldI;
                        } else {
                        } else {
@@ -529,15 +535,21 @@ class WallpaperController {
                            mUpperWallpaperTarget = oldW;
                            mUpperWallpaperTarget = oldW;
                            mLowerWallpaperTarget = wallpaperTarget;
                            mLowerWallpaperTarget = wallpaperTarget;
                        }
                        }

                        if (newTargetHidden && !oldTargetHidden) {
                        // If the new target is going hidden, set it back to the old target.
                        if (wallpaperTarget.mAppToken != null
                                && wallpaperTarget.mAppToken.hiddenRequested) {
                            if (DEBUG_WALLPAPER_LIGHT) Slog.v(TAG,
                            if (DEBUG_WALLPAPER_LIGHT) Slog.v(TAG,
                                    "Old wallpaper still the target.");
                                    "Old wallpaper still the target.");
                            // Use the old target if new target is hidden but old target
                            // is not. If they're both hidden, still use the new target.
                            mWallpaperTarget = oldW;
                        } else if (newTargetHidden == oldTargetHidden
                                && !mService.mOpeningApps.contains(wallpaperTarget.mAppToken)
                                    && (mService.mOpeningApps.contains(oldW.mAppToken)
                                    || mService.mClosingApps.contains(oldW.mAppToken))) {
                            // If they're both hidden (or both not hidden), prefer the one that's
                            // currently in opening or closing app list, this allows transition
                            // selection logic to better determine the wallpaper status of
                            // opening/closing apps.
                            mWallpaperTarget = oldW;
                            mWallpaperTarget = oldW;
                            wallpaperTarget = oldW;
                            wallpaperTargetIndex = oldI;
                        }
                        }
                    }
                    }
                }
                }