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

Commit 5bdccba4 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Remove WindowStateAnimator.isAnimationSet

Test: boots
Change-Id: I39f7b1afa852ed627d5a7d61d5d84724f1d76c05
parent 34560ec2
Loading
Loading
Loading
Loading
+5 −4
Original line number Original line Diff line number Diff line
@@ -443,7 +443,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo


        // If this window is animating, make a note that we have an animating window and take
        // If this window is animating, make a note that we have an animating window and take
        // care of a request to run a detached wallpaper animation.
        // care of a request to run a detached wallpaper animation.
        if (winAnimator.isAnimationSet()) {
        if (w.isAnimating()) {
            final AnimationAdapter anim = w.getAnimation();
            final AnimationAdapter anim = w.getAnimation();
            if (anim != null) {
            if (anim != null) {
                if ((flags & FLAG_SHOW_WALLPAPER) != 0 && anim.getDetachWallpaper()) {
                if ((flags & FLAG_SHOW_WALLPAPER) != 0 && anim.getDetachWallpaper()) {
@@ -2740,17 +2740,18 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
                if (highestTarget != null) {
                if (highestTarget != null) {
                    final AppTransition appTransition = mService.mAppTransition;
                    final AppTransition appTransition = mService.mAppTransition;
                    if (DEBUG_INPUT_METHOD) Slog.v(TAG_WM, appTransition + " " + highestTarget
                    if (DEBUG_INPUT_METHOD) Slog.v(TAG_WM, appTransition + " " + highestTarget
                            + " animating=" + highestTarget.mWinAnimator.isAnimationSet()
                            + " animating=" + highestTarget.isAnimating()
                            + " layer=" + highestTarget.mWinAnimator.mAnimLayer
                            + " layer=" + highestTarget.mWinAnimator.mAnimLayer
                            + " new layer=" + target.mWinAnimator.mAnimLayer);
                            + " new layer=" + target.mWinAnimator.mAnimLayer);


                    final boolean higherLayer =
                            highestTarget.mWinAnimator.mAnimLayer > target.mWinAnimator.mAnimLayer;
                    if (appTransition.isTransitionSet()) {
                    if (appTransition.isTransitionSet()) {
                        // If we are currently setting up for an animation, hold everything until we
                        // If we are currently setting up for an animation, hold everything until we
                        // can find out what will happen.
                        // can find out what will happen.
                        setInputMethodTarget(highestTarget, true);
                        setInputMethodTarget(highestTarget, true);
                        return highestTarget;
                        return highestTarget;
                    } else if (highestTarget.mWinAnimator.isAnimationSet() &&
                    } else if (highestTarget.isAnimating() && higherLayer) {
                            highestTarget.mWinAnimator.mAnimLayer > target.mWinAnimator.mAnimLayer) {
                        // If the window we are currently targeting is involved with an animation,
                        // If the window we are currently targeting is involved with an animation,
                        // and it is on top of the next target we will be over, then hold off on
                        // and it is on top of the next target we will be over, then hold off on
                        // moving until that is done.
                        // moving until that is done.
+2 −2
Original line number Original line Diff line number Diff line
@@ -177,7 +177,7 @@ class WallpaperController {
                && (mWallpaperTarget == w || w.isDrawFinishedLw())) {
                && (mWallpaperTarget == w || w.isDrawFinishedLw())) {
            if (DEBUG_WALLPAPER) Slog.v(TAG, "Found wallpaper target: " + w);
            if (DEBUG_WALLPAPER) Slog.v(TAG, "Found wallpaper target: " + w);
            mFindResults.setWallpaperTarget(w);
            mFindResults.setWallpaperTarget(w);
            if (w == mWallpaperTarget && w.mWinAnimator.isAnimationSet()) {
            if (w == mWallpaperTarget && w.isAnimating()) {
                // The current wallpaper target is animating, so we'll look behind it for
                // The current wallpaper target is animating, so we'll look behind it for
                // another possible target and figure out what is going on later.
                // another possible target and figure out what is going on later.
                if (DEBUG_WALLPAPER) Slog.v(TAG,
                if (DEBUG_WALLPAPER) Slog.v(TAG,
@@ -243,7 +243,7 @@ class WallpaperController {
    }
    }


    boolean isWallpaperTargetAnimating() {
    boolean isWallpaperTargetAnimating() {
        return mWallpaperTarget != null && mWallpaperTarget.mWinAnimator.isAnimationSet()
        return mWallpaperTarget != null && mWallpaperTarget.isAnimating()
                && (mWallpaperTarget.mAppToken == null
                && (mWallpaperTarget.mAppToken == null
                        || !mWallpaperTarget.mAppToken.isWaitingForTransitionStart());
                        || !mWallpaperTarget.mAppToken.isWaitingForTransitionStart());
    }
    }
+1 −1
Original line number Original line Diff line number Diff line
@@ -2209,7 +2209,7 @@ public class WindowManagerService extends IWindowManager.Stub
        if (win.isWinVisibleLw() && winAnimator.applyAnimationLocked(transit, false)) {
        if (win.isWinVisibleLw() && winAnimator.applyAnimationLocked(transit, false)) {
            focusMayChange = isDefaultDisplay;
            focusMayChange = isDefaultDisplay;
            win.mAnimatingExit = true;
            win.mAnimatingExit = true;
        } else if (win.mWinAnimator.isAnimationSet()) {
        } else if (win.isAnimating()) {
            // Currently in a hide animation... turn this into
            // Currently in a hide animation... turn this into
            // an exit.
            // an exit.
            win.mAnimatingExit = true;
            win.mAnimatingExit = true;
+18 −17
Original line number Original line Diff line number Diff line
@@ -1364,7 +1364,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
    @Override
    @Override
    boolean hasContentToDisplay() {
    boolean hasContentToDisplay() {
        if (!mAppFreezing && isDrawnLw() && (mViewVisibility == View.VISIBLE
        if (!mAppFreezing && isDrawnLw() && (mViewVisibility == View.VISIBLE
                || (mWinAnimator.isAnimationSet() && !mService.mAppTransition.isTransitionSet()))) {
                || (isAnimating() && !mService.mAppTransition.isTransitionSet()))) {
            return true;
            return true;
        }
        }


@@ -1443,9 +1443,9 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        final AppWindowToken atoken = mAppToken;
        final AppWindowToken atoken = mAppToken;
        if (atoken != null) {
        if (atoken != null) {
            return ((!isParentWindowHidden() && !atoken.hiddenRequested)
            return ((!isParentWindowHidden() && !atoken.hiddenRequested)
                    || mWinAnimator.isAnimationSet());
                    || isAnimating());
        }
        }
        return !isParentWindowHidden() || mWinAnimator.isAnimationSet();
        return !isParentWindowHidden() || isAnimating();
    }
    }


    /**
    /**
@@ -1476,9 +1476,10 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        if (mToken.waitingToShow && mService.mAppTransition.isTransitionSet()) {
        if (mToken.waitingToShow && mService.mAppTransition.isTransitionSet()) {
            return false;
            return false;
        }
        }
        final boolean parentAndClientVisible = !isParentWindowHidden()
                && mViewVisibility == View.VISIBLE && !mToken.isHidden();
        return mHasSurface && mPolicyVisibility && !mDestroying
        return mHasSurface && mPolicyVisibility && !mDestroying
                && ((!isParentWindowHidden() && mViewVisibility == View.VISIBLE && !mToken.isHidden())
                && (parentAndClientVisible || isAnimating());
                        || mWinAnimator.isAnimationSet());
    }
    }


    // TODO: Another visibility method that was added late in the release to minimize risk.
    // TODO: Another visibility method that was added late in the release to minimize risk.
@@ -1508,7 +1509,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        final AppWindowToken atoken = mAppToken;
        final AppWindowToken atoken = mAppToken;
        return isDrawnLw() && mPolicyVisibility
        return isDrawnLw() && mPolicyVisibility
                && ((!isParentWindowHidden() && (atoken == null || !atoken.hiddenRequested))
                && ((!isParentWindowHidden() && (atoken == null || !atoken.hiddenRequested))
                        || mWinAnimator.isAnimationSet());
                        || isAnimating());
    }
    }


    /**
    /**
@@ -1562,7 +1563,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        // to determine if it's occluding apps.
        // to determine if it's occluding apps.
        return ((!mIsWallpaper && mAttrs.format == PixelFormat.OPAQUE)
        return ((!mIsWallpaper && mAttrs.format == PixelFormat.OPAQUE)
                || (mIsWallpaper && mWallpaperVisible))
                || (mIsWallpaper && mWallpaperVisible))
                && isDrawnLw() && !mWinAnimator.isAnimationSet();
                && isDrawnLw() && !isAnimating();
    }
    }


    @Override
    @Override
@@ -1849,7 +1850,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
                    + " mRemoveOnExit=" + mRemoveOnExit
                    + " mRemoveOnExit=" + mRemoveOnExit
                    + " mHasSurface=" + mHasSurface
                    + " mHasSurface=" + mHasSurface
                    + " surfaceShowing=" + mWinAnimator.getShown()
                    + " surfaceShowing=" + mWinAnimator.getShown()
                    + " isAnimationSet=" + mWinAnimator.isAnimationSet()
                    + " animating=" + isAnimating()
                    + " app-animation="
                    + " app-animation="
                    + (mAppToken != null ? mAppToken.isSelfAnimating() : "false")
                    + (mAppToken != null ? mAppToken.isSelfAnimating() : "false")
                    + " mWillReplaceWindow=" + mWillReplaceWindow
                    + " mWillReplaceWindow=" + mWillReplaceWindow
@@ -1916,7 +1917,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
                        mService.mAccessibilityController.onWindowTransitionLocked(this, transit);
                        mService.mAccessibilityController.onWindowTransitionLocked(this, transit);
                    }
                    }
                }
                }
                final boolean isAnimating = mWinAnimator.isAnimationSet()
                final boolean isAnimating = isAnimating()
                        && (mAppToken == null || !mAppToken.isWaitingForTransitionStart());
                        && (mAppToken == null || !mAppToken.isWaitingForTransitionStart());
                final boolean lastWindowIsStartingWindow = startingWindow && mAppToken != null
                final boolean lastWindowIsStartingWindow = startingWindow && mAppToken != null
                        && mAppToken.isLastWindow(this);
                        && mAppToken.isLastWindow(this);
@@ -2434,10 +2435,10 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        if (DEBUG_VISIBILITY) Slog.v(TAG, "Policy visibility true: " + this);
        if (DEBUG_VISIBILITY) Slog.v(TAG, "Policy visibility true: " + this);
        if (doAnimation) {
        if (doAnimation) {
            if (DEBUG_VISIBILITY) Slog.v(TAG, "doAnimation: mPolicyVisibility="
            if (DEBUG_VISIBILITY) Slog.v(TAG, "doAnimation: mPolicyVisibility="
                    + mPolicyVisibility + " isAnimationSet=" + mWinAnimator.isAnimationSet());
                    + mPolicyVisibility + " animating=" + isAnimating());
            if (!mToken.okToAnimate()) {
            if (!mToken.okToAnimate()) {
                doAnimation = false;
                doAnimation = false;
            } else if (mPolicyVisibility && !mWinAnimator.isAnimationSet()) {
            } else if (mPolicyVisibility && !isAnimating()) {
                // Check for the case where we are currently visible and
                // Check for the case where we are currently visible and
                // not animating; we do not want to do animation at such a
                // not animating; we do not want to do animation at such a
                // point to become visible when we already are.
                // point to become visible when we already are.
@@ -2476,7 +2477,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        }
        }
        if (doAnimation) {
        if (doAnimation) {
            mWinAnimator.applyAnimationLocked(TRANSIT_EXIT, false);
            mWinAnimator.applyAnimationLocked(TRANSIT_EXIT, false);
            if (!mWinAnimator.isAnimationSet()) {
            if (!isAnimating()) {
                doAnimation = false;
                doAnimation = false;
            }
            }
        }
        }
@@ -3697,7 +3698,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
                    + " tok.hiddenRequested="
                    + " tok.hiddenRequested="
                    + (mAppToken != null && mAppToken.hiddenRequested)
                    + (mAppToken != null && mAppToken.hiddenRequested)
                    + " tok.hidden=" + (mAppToken != null && mAppToken.isHidden())
                    + " tok.hidden=" + (mAppToken != null && mAppToken.isHidden())
                    + " animationSet=" + mWinAnimator.isAnimationSet()
                    + " animating=" + isAnimating()
                    + " tok animating="
                    + " tok animating="
                    + (mAppToken != null && mAppToken.isSelfAnimating())
                    + (mAppToken != null && mAppToken.isSelfAnimating())
                    + " Callers=" + Debug.getCallers(4));
                    + " Callers=" + Debug.getCallers(4));
@@ -4110,25 +4111,25 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        }
        }
        if (DEBUG_VISIBILITY) {
        if (DEBUG_VISIBILITY) {
            Slog.v(TAG, "Win " + this + ": isDrawn=" + isDrawnLw()
            Slog.v(TAG, "Win " + this + ": isDrawn=" + isDrawnLw()
                    + ", isAnimationSet=" + mWinAnimator.isAnimationSet());
                    + ", animating=" + isAnimating());
            if (!isDrawnLw()) {
            if (!isDrawnLw()) {
                Slog.v(TAG, "Not displayed: s=" + mWinAnimator.mSurfaceController
                Slog.v(TAG, "Not displayed: s=" + mWinAnimator.mSurfaceController
                        + " pv=" + mPolicyVisibility
                        + " pv=" + mPolicyVisibility
                        + " mDrawState=" + mWinAnimator.mDrawState
                        + " mDrawState=" + mWinAnimator.mDrawState
                        + " ph=" + isParentWindowHidden()
                        + " ph=" + isParentWindowHidden()
                        + " th=" + (mAppToken != null ? mAppToken.hiddenRequested : false)
                        + " th=" + (mAppToken != null ? mAppToken.hiddenRequested : false)
                        + " a=" + mWinAnimator.isAnimationSet());
                        + " a=" + isAnimating());
            }
            }
        }
        }


        results.numInteresting++;
        results.numInteresting++;
        if (isDrawnLw()) {
        if (isDrawnLw()) {
            results.numDrawn++;
            results.numDrawn++;
            if (!mWinAnimator.isAnimationSet()) {
            if (!isAnimating()) {
                results.numVisible++;
                results.numVisible++;
            }
            }
            results.nowGone = false;
            results.nowGone = false;
        } else if (mWinAnimator.isAnimationSet()) {
        } else if (isAnimating()) {
            results.nowGone = false;
            results.nowGone = false;
        }
        }
    }
    }
+2 −9
Original line number Original line Diff line number Diff line
@@ -253,13 +253,6 @@ class WindowStateAnimator {
        mWallpaperControllerLocked = mService.mRoot.mWallpaperController;
        mWallpaperControllerLocked = mService.mRoot.mWallpaperController;
    }
    }


    /**
     * Is the window or its container currently set to animate or currently animating?
     */
    boolean isAnimationSet() {
        return mWin.isAnimating();
    }

    void cancelExitAnimationForNextAnimationLocked() {
    void cancelExitAnimationForNextAnimationLocked() {
        if (DEBUG_ANIM) Slog.d(TAG,
        if (DEBUG_ANIM) Slog.d(TAG,
                "cancelExitAnimationForNextAnimationLocked: " + mWin);
                "cancelExitAnimationForNextAnimationLocked: " + mWin);
@@ -1197,7 +1190,7 @@ class WindowStateAnimator {
                w.mToken.hasVisible = true;
                w.mToken.hasVisible = true;
            }
            }
        } else {
        } else {
            if (DEBUG_ANIM && isAnimationSet()) {
            if (DEBUG_ANIM && mWin.isAnimating()) {
                Slog.v(TAG, "prepareSurface: No changes in animation for " + this);
                Slog.v(TAG, "prepareSurface: No changes in animation for " + this);
            }
            }
            displayed = true;
            displayed = true;
@@ -1407,7 +1400,7 @@ class WindowStateAnimator {
        }
        }


        Trace.traceEnd(Trace.TRACE_TAG_WINDOW_MANAGER);
        Trace.traceEnd(Trace.TRACE_TAG_WINDOW_MANAGER);
        return isAnimationSet();
        return mWin.isAnimating();
    }
    }


    void writeToProto(ProtoOutputStream proto, long fieldId) {
    void writeToProto(ProtoOutputStream proto, long fieldId) {
Loading