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

Commit 1d63fa9a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes I842f377d,Id9708781

* changes:
  Make WC#applyAnimation can apply on Task / TaskStack layer (2/N)
  Make WC#applyAnimation can apply on Task / TaskStack layer (1/N)
parents cb8823d9 5bd11afa
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -555,7 +555,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A

    private RemoteAnimationDefinition mRemoteAnimationDefinition;

    private AnimatingActivityRegistry mAnimatingActivityRegistry;
    AnimatingActivityRegistry mAnimatingActivityRegistry;

    private Task mLastParent;

@@ -3088,7 +3088,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A

        ProtoLog.v(WM_DEBUG_APP_TRANSITIONS,
                "Removing app %s delayed=%b animation=%s animating=%b", this, delayed,
                getAnimation(), isAnimating(TRANSITION));
                getAnimation(), isAnimating(TRANSITION | PARENTS));

        ProtoLog.v(WM_DEBUG_ADD_REMOVE, "removeAppToken: %s"
                + " delayed=%b Callers=%s", this, delayed, Debug.getCallers(4));
@@ -3100,7 +3100,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        // If this window was animating, then we need to ensure that the app transition notifies
        // that animations have completed in DisplayContent.handleAnimatingStoppedAndTransition(),
        // so add to that list now
        if (isAnimating(TRANSITION)) {
        if (isAnimating(TRANSITION | PARENTS)) {
            getDisplayContent().mNoAnimationNotifyOnTransitionFinished.add(token);
        }

@@ -3436,7 +3436,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
     *         color mode set to avoid jank in the middle of the transition.
     */
    boolean canShowWindows() {
        return allDrawn && !(isAnimating() && hasNonDefaultColorWindow());
        return allDrawn && !(isAnimating(PARENTS) && hasNonDefaultColorWindow());
    }

    /**
@@ -5343,13 +5343,13 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        if (!allDrawn && w.mightAffectAllDrawn()) {
            if (DEBUG_VISIBILITY || WM_DEBUG_ORIENTATION.isLogToLogcat()) {
                Slog.v(TAG, "Eval win " + w + ": isDrawn=" + w.isDrawnLw()
                        + ", isAnimationSet=" + isAnimating(TRANSITION));
                        + ", isAnimationSet=" + isAnimating(TRANSITION | PARENTS));
                if (!w.isDrawnLw()) {
                    Slog.v(TAG, "Not displayed: s=" + winAnimator.mSurfaceController
                            + " pv=" + w.isVisibleByPolicy()
                            + " mDrawState=" + winAnimator.drawStateToString()
                            + " ph=" + w.isParentWindowHidden() + " th=" + mVisibleRequested
                            + " a=" + isAnimating(TRANSITION));
                            + " a=" + isAnimating(TRANSITION | PARENTS));
                }
            }

@@ -5950,7 +5950,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A

    @Override
    void prepareSurfaces() {
        final boolean show = isVisible() || isAnimating();
        final boolean show = isVisible() || isAnimating(PARENTS);

        if (mSurfaceControl != null) {
            if (show && !mLastSurfaceShowing) {
@@ -5978,7 +5978,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
    }

    void attachThumbnailAnimation() {
        if (!isAnimating()) {
        if (!isAnimating(PARENTS)) {
            return;
        }
        final GraphicBuffer thumbnailHeader =
@@ -5998,7 +5998,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
     * {@link android.app.ActivityOptions#ANIM_OPEN_CROSS_PROFILE_APPS} animation.
     */
    void attachCrossProfileAppsThumbnailAnimation() {
        if (!isAnimating()) {
        if (!isAnimating(PARENTS)) {
            return;
        }
        clearThumbnail();
@@ -7516,7 +7516,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        super.dumpDebug(proto, WINDOW_TOKEN, logLevel);
        proto.write(LAST_SURFACE_SHOWING, mLastSurfaceShowing);
        proto.write(IS_WAITING_FOR_TRANSITION_START, isWaitingForTransitionStart());
        proto.write(IS_ANIMATING, isAnimating());
        proto.write(IS_ANIMATING, isAnimating(PARENTS));
        if (mThumbnail != null){
            mThumbnail.dumpDebug(proto, THUMBNAIL);
        }
+12 −0
Original line number Diff line number Diff line
@@ -4888,6 +4888,18 @@ class ActivityStack extends WindowContainer<WindowContainer> implements BoundsAn
        }
    }

    @Override
    protected void onAnimationFinished() {
        super.onAnimationFinished();
        // TODO(b/142617871): we may need to add animation type parameter on onAnimationFinished to
        //  identify if the callback is for launch animation finish and then calling
        //  activity#onAnimationFinished.
        final ActivityRecord activity = getTopMostActivity();
        if (activity != null) {
            activity.onAnimationFinished();
        }
    }

    /**
     * Sets the current picture-in-picture aspect ratio.
     */
+5 −3
Original line number Diff line number Diff line
@@ -436,9 +436,11 @@ public class AppTransition implements Dump {
        mNextAppTransition = TRANSIT_UNSET;
        mNextAppTransitionFlags = 0;
        setAppTransitionState(APP_STATE_RUNNING);
        final AnimationAdapter topOpeningAnim = topOpeningApp != null
                ? topOpeningApp.getAnimation()
        final AnimationAdapter topOpeningAnim =
                (topOpeningApp != null && topOpeningApp.getAnimatingContainer() != null)
                        ? topOpeningApp.getAnimatingContainer().getAnimation()
                        : null;

        int redoLayout = notifyAppTransitionStartingLocked(transit,
                topOpeningAnim != null ? topOpeningAnim.getDurationHint() : 0,
                topOpeningAnim != null
+1 −1
Original line number Diff line number Diff line
@@ -3360,7 +3360,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
                // to look at all windows below the current target that are in this app, finding the
                // highest visible one in layering.
                WindowState highestTarget = null;
                if (activity.isAnimating(TRANSITION)) {
                if (activity.isAnimating(PARENTS | TRANSITION)) {
                    highestTarget = activity.getHighestAnimLayerWindow(curTarget);
                }

+3 −2
Original line number Diff line number Diff line
@@ -378,9 +378,10 @@ class RemoteAnimationController implements DeathRecipient {

        int getMode() {
            final DisplayContent dc = mWindowContainer.getDisplayContent();
            if (dc.mOpeningApps.contains(mWindowContainer)) {
            final ActivityRecord topActivity = mWindowContainer.getTopMostActivity();
            if (dc.mOpeningApps.contains(topActivity)) {
                return RemoteAnimationTarget.MODE_OPENING;
            } else if (dc.mChangingApps.contains(mWindowContainer)) {
            } else if (dc.mChangingApps.contains(topActivity)) {
                return RemoteAnimationTarget.MODE_CHANGING;
            } else {
                return RemoteAnimationTarget.MODE_CLOSING;
Loading