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

Commit b74f3b45 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Centralize assignment of pip enter animation type" into udc-dev am:...

Merge "Centralize assignment of pip enter animation type" into udc-dev am: b4a8a82f am: 9b17b356

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22572957



Change-Id: I246f190ccc8dde34e0f346a7b62547f30103bca8
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 4009beb4 9b17b356
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -716,15 +716,16 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
            return;
            return;
        }
        }


        final int animationType = shouldAlwaysFadeIn()
                ? ANIM_TYPE_ALPHA
                : mPipAnimationController.takeOneShotEnterAnimationType();
        if (Transitions.ENABLE_SHELL_TRANSITIONS) {
        if (Transitions.ENABLE_SHELL_TRANSITIONS) {
            mPipTransitionController.setEnterAnimationType(animationType);
            // For Shell transition, we will animate the window in PipTransition#startAnimation
            // For Shell transition, we will animate the window in PipTransition#startAnimation
            // instead of #onTaskAppeared.
            // instead of #onTaskAppeared.
            return;
            return;
        }
        }


        final int animationType = shouldAlwaysFadeIn()
                ? ANIM_TYPE_ALPHA
                : mPipAnimationController.takeOneShotEnterAnimationType();
        if (mWaitForFixedRotation) {
        if (mWaitForFixedRotation) {
            onTaskAppearedWithFixedRotation(animationType);
            onTaskAppearedWithFixedRotation(animationType);
            return;
            return;
+5 −5
Original line number Original line Diff line number Diff line
@@ -274,9 +274,6 @@ public class PipTransition extends PipTransitionController {
        if (!requestHasPipEnter(request)) {
        if (!requestHasPipEnter(request)) {
            throw new IllegalStateException("Called PiP augmentRequest when request has no PiP");
            throw new IllegalStateException("Called PiP augmentRequest when request has no PiP");
        }
        }
        mEnterAnimationType = mPipOrganizer.shouldAlwaysFadeIn()
                ? ANIM_TYPE_ALPHA
                : mPipAnimationController.takeOneShotEnterAnimationType();
        if (mEnterAnimationType == ANIM_TYPE_ALPHA) {
        if (mEnterAnimationType == ANIM_TYPE_ALPHA) {
            mRequestedEnterTransition = transition;
            mRequestedEnterTransition = transition;
            mRequestedEnterTask = request.getTriggerTask().token;
            mRequestedEnterTask = request.getTriggerTask().token;
@@ -665,6 +662,11 @@ public class PipTransition extends PipTransitionController {
        return false;
        return false;
    }
    }


    @Override
    public void setEnterAnimationType(@PipAnimationController.AnimationType int type) {
        mEnterAnimationType = type;
    }

    private void startEnterAnimation(@NonNull TransitionInfo info,
    private void startEnterAnimation(@NonNull TransitionInfo info,
            @NonNull SurfaceControl.Transaction startTransaction,
            @NonNull SurfaceControl.Transaction startTransaction,
            @NonNull SurfaceControl.Transaction finishTransaction,
            @NonNull SurfaceControl.Transaction finishTransaction,
@@ -786,8 +788,6 @@ public class PipTransition extends PipTransitionController {


        final int enterAnimationType = mEnterAnimationType;
        final int enterAnimationType = mEnterAnimationType;
        if (enterAnimationType == ANIM_TYPE_ALPHA) {
        if (enterAnimationType == ANIM_TYPE_ALPHA) {
            // Restore to default type.
            mEnterAnimationType = ANIM_TYPE_BOUNDS;
            startTransaction.setAlpha(leash, 0f);
            startTransaction.setAlpha(leash, 0f);
        }
        }
        startTransaction.apply();
        startTransaction.apply();
+4 −0
Original line number Original line Diff line number Diff line
@@ -225,6 +225,10 @@ public abstract class PipTransitionController implements Transitions.TransitionH
        throw new IllegalStateException("Request isn't entering PiP");
        throw new IllegalStateException("Request isn't entering PiP");
    }
    }


    /** Sets the type of animation when a PiP task appears. */
    public void setEnterAnimationType(@PipAnimationController.AnimationType int type) {
    }

    /** Play a transition animation for entering PiP on a specific PiP change. */
    /** Play a transition animation for entering PiP on a specific PiP change. */
    public void startEnterAnimation(@NonNull final TransitionInfo.Change pipChange,
    public void startEnterAnimation(@NonNull final TransitionInfo.Change pipChange,
            @NonNull final SurfaceControl.Transaction startTransaction,
            @NonNull final SurfaceControl.Transaction startTransaction,