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

Commit 9ea15e69 authored by Ikram Gabiyev's avatar Ikram Gabiyev Committed by Automerger Merge Worker
Browse files

Merge "Make sure move task to back is handled by shell" into udc-dev am: c2970d74 am: da67a78c

parents 8ef11c30 da67a78c
Loading
Loading
Loading
Loading
+16 −1
Original line number Original line Diff line number Diff line
@@ -26,6 +26,7 @@ import static android.view.Surface.ROTATION_90;
import static android.view.WindowManager.TRANSIT_CHANGE;
import static android.view.WindowManager.TRANSIT_CHANGE;
import static android.view.WindowManager.TRANSIT_OPEN;
import static android.view.WindowManager.TRANSIT_OPEN;
import static android.view.WindowManager.TRANSIT_PIP;
import static android.view.WindowManager.TRANSIT_PIP;
import static android.view.WindowManager.TRANSIT_TO_BACK;
import static android.view.WindowManager.transitTypeToString;
import static android.view.WindowManager.transitTypeToString;
import static android.window.TransitionInfo.FLAG_IS_DISPLAY;
import static android.window.TransitionInfo.FLAG_IS_DISPLAY;


@@ -92,6 +93,8 @@ public class PipTransition extends PipTransitionController {
    private final Rect mExitDestinationBounds = new Rect();
    private final Rect mExitDestinationBounds = new Rect();
    @Nullable
    @Nullable
    private IBinder mExitTransition;
    private IBinder mExitTransition;
    @Nullable
    private IBinder mMoveToBackTransition;
    private IBinder mRequestedEnterTransition;
    private IBinder mRequestedEnterTransition;
    private WindowContainerToken mRequestedEnterTask;
    private WindowContainerToken mRequestedEnterTask;
    /** The Task window that is currently in PIP windowing mode. */
    /** The Task window that is currently in PIP windowing mode. */
@@ -171,9 +174,10 @@ public class PipTransition extends PipTransitionController {


        // Exiting PIP.
        // Exiting PIP.
        final int type = info.getType();
        final int type = info.getType();
        if (transition.equals(mExitTransition)) {
        if (transition.equals(mExitTransition) || transition.equals(mMoveToBackTransition)) {
            mExitDestinationBounds.setEmpty();
            mExitDestinationBounds.setEmpty();
            mExitTransition = null;
            mExitTransition = null;
            mMoveToBackTransition = null;
            mHasFadeOut = false;
            mHasFadeOut = false;
            if (mFinishCallback != null) {
            if (mFinishCallback != null) {
                callFinishCallback(null /* wct */);
                callFinishCallback(null /* wct */);
@@ -201,6 +205,8 @@ public class PipTransition extends PipTransitionController {
                    startExitToSplitAnimation(info, startTransaction, finishTransaction,
                    startExitToSplitAnimation(info, startTransaction, finishTransaction,
                            finishCallback, pipTaskInfo);
                            finishCallback, pipTaskInfo);
                    break;
                    break;
                case TRANSIT_TO_BACK:
                    // pass through here is intended
                case TRANSIT_REMOVE_PIP:
                case TRANSIT_REMOVE_PIP:
                    removePipImmediately(info, startTransaction, finishTransaction, finishCallback,
                    removePipImmediately(info, startTransaction, finishTransaction, finishCallback,
                            pipTaskInfo);
                            pipTaskInfo);
@@ -273,6 +279,15 @@ public class PipTransition extends PipTransitionController {
            WindowContainerTransaction wct = new WindowContainerTransaction();
            WindowContainerTransaction wct = new WindowContainerTransaction();
            augmentRequest(transition, request, wct);
            augmentRequest(transition, request, wct);
            return wct;
            return wct;
        } else if (request.getType() == TRANSIT_TO_BACK && request.getTriggerTask() != null
                && request.getTriggerTask().getWindowingMode() == WINDOWING_MODE_PINNED) {
            // if we receive a TRANSIT_TO_BACK type of request while in PiP
            mMoveToBackTransition = transition;
            // update the transition state to avoid {@link PipTaskOrganizer#onTaskVanished()} calls
            mPipTransitionState.setTransitionState(PipTransitionState.EXITING_PIP);

            // return an empty WindowContainerTransaction so that we don't check other handlers
            return new WindowContainerTransaction();
        } else {
        } else {
            return null;
            return null;
        }
        }