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

Commit 417f329c authored by Merissa Mitchell's avatar Merissa Mitchell Committed by Android (Google) Code Review
Browse files

Merge "[PiP on Desktop] Don't start Transition to update inset if wct is empty." into main

parents 8971c7a3 5973b832
Loading
Loading
Loading
Loading
+15 −13
Original line number Diff line number Diff line
@@ -570,20 +570,22 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
        relayout(mRelayoutParams, startT, finishT, wct, oldRootView, mResult);
        // After this line, mTaskInfo is up-to-date and should be used instead of taskInfo

        if (!wct.isEmpty()) {
            if (DesktopExperienceFlags.ENABLE_DESKTOP_WINDOWING_PIP.isTrue()
                    && mRelayoutParams.mShouldSetAppBounds) {
            // When expanding from PiP to freeform, we need to start a Transition for applying the
            // inset changes so that PiP receives the insets for the final bounds. This is because
            // |mShouldSetAppBounds| applies the insets by modifying app bounds, which can cause a
            // bounds offset that needs to be reported to transition handlers.
                // When expanding from PiP to freeform, we need to start a Transition for applying
                // the inset changes so that PiP receives the insets for the final bounds. This is
                // because |mShouldSetAppBounds| applies the insets by modifying app bounds, which
                // can cause a bounds offset that needs to be reported to transition handlers.
                Trace.beginSection("DesktopModeWindowDecoration#relayout-startTransition");
            mHandler.post(
                    () -> mTransitions.startTransition(TRANSIT_CHANGE, wct, /* handler= */ null));
                mHandler.post(() -> mTransitions.startTransition(TRANSIT_CHANGE, wct,
                        /* handler= */ null));
            } else {
                Trace.beginSection("DesktopModeWindowDecoration#relayout-applyWCT");
                mBgExecutor.execute(() -> mTaskOrganizer.applyTransaction(wct));
            }
            Trace.endSection();
        }

        if (mResult.mRootView == null) {
            // This means something blocks the window decor from showing, e.g. the task is hidden.