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

Commit 2e086e36 authored by Ikram Gabiyev's avatar Ikram Gabiyev Committed by Android (Google) Code Review
Browse files

Merge "Jumpcut animation to exit PiP while entering PiP" into main

parents f5a79460 4fbf06ab
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -597,6 +597,17 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
            return;
        }

        if (mPipTransitionState.isEnteringPip()
                && !mPipTransitionState.getInSwipePipToHomeTransition()) {
            // If we are still entering PiP with Shell playing enter animation, jump-cut to
            // the end of the enter animation and reschedule exitPip to run after enter-PiP
            // has finished its transition and allowed the client to draw in PiP mode.
            mPipTransitionController.end(() -> {
                exitPip(animationDurationMs, requestEnterSplit);
            });
            return;
        }

        ProtoLog.d(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE,
                "exitPip: %s, state=%s", mTaskInfo.topActivity, mPipTransitionState);
        final WindowContainerTransaction wct = new WindowContainerTransaction();
+10 −4
Original line number Diff line number Diff line
@@ -43,7 +43,6 @@ import static com.android.wm.shell.transition.Transitions.TRANSIT_EXIT_PIP;
import static com.android.wm.shell.transition.Transitions.TRANSIT_EXIT_PIP_TO_SPLIT;
import static com.android.wm.shell.transition.Transitions.TRANSIT_REMOVE_PIP;

import android.animation.Animator;
import android.annotation.IntDef;
import android.app.ActivityManager;
import android.app.TaskInfo;
@@ -348,9 +347,16 @@ public class PipTransition extends PipTransitionController {

    @Override
    public void end() {
        Animator animator = mPipAnimationController.getCurrentAnimator();
        if (animator != null && animator.isRunning()) {
            animator.end();
        end(null);
    }

    @Override
    public void end(@Nullable Runnable onTransitionEnd) {
        if (mPipAnimationController.isAnimating()) {
            mPipAnimationController.getCurrentAnimator().end();
        }
        if (onTransitionEnd != null) {
            onTransitionEnd.run();
        }
    }

+8 −0
Original line number Diff line number Diff line
@@ -305,6 +305,14 @@ public abstract class PipTransitionController implements Transitions.TransitionH
    public void end() {
    }

    /**
     * End the currently-playing PiP animation.
     *
     * @param onTransitionEnd callback to run upon finishing the playing transition.
     */
    public void end(@Nullable Runnable onTransitionEnd) {
    }

    /** Starts the {@link android.window.SystemPerformanceHinter.HighPerfSession}. */
    public void startHighPerfSession() {}