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

Commit bf3bc512 authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Fix issue with do-not-pip and bookend transition" into main

parents aef1832b 6ff8b2a0
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -555,6 +555,23 @@ class TransitionController {
        return null;
    }

    /**
     * @return The playing transition that is transiently-hiding the given {@param container}, or
     *         null if there isn't one
     * @param container A participant of a transient-hide transition
     */
    @Nullable
    Transition getTransientHideTransitionForContainer(
            @NonNull WindowContainer container) {
        for (int i = mPlayingTransitions.size() - 1; i >= 0; --i) {
            final Transition transition = mPlayingTransitions.get(i);
            if (transition.isInTransientHide(container)) {
                return transition;
            }
        }
        return null;
    }

    /** Returns {@code true} if the display contains a transient-launch transition. */
    boolean hasTransientLaunch(@NonNull DisplayContent dc) {
        if (mCollectingTransition != null && mCollectingTransition.hasTransientLaunch()
+17 −3
Original line number Diff line number Diff line
@@ -702,11 +702,25 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub

                if ((entry.getValue().getChangeMask()
                        & WindowContainerTransaction.Change.CHANGE_FORCE_NO_PIP) != 0) {
                    if (com.android.wm.shell.Flags.enableRecentsBookendTransition()) {
                        // If we are using a bookend transition, then the transition that we need
                        // to disable pip on finish is the original transient transition, not the
                        // bookend transition
                        final Transition transientHideTransition =
                                mTransitionController.getTransientHideTransitionForContainer(wc);
                        if (transientHideTransition != null) {
                            transientHideTransition.setCanPipOnFinish(false);
                        } else {
                            ProtoLog.v(WmProtoLogGroups.WM_DEBUG_WINDOW_TRANSITIONS,
                                    "Set do-not-pip: no task");
                        }
                    } else {
                        // Disable entering pip (eg. when recents pretends to finish itself)
                        if (chain.mTransition != null) {
                            chain.mTransition.setCanPipOnFinish(false /* canPipOnFinish */);
                        }
                    }
                }
                // A bit hacky, but we need to detect "remove PiP" so that we can "wrap" the
                // setWindowingMode call in force-hidden.
                boolean forceHiddenForPip = false;