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

Commit 1cfbc363 authored by Mateusz Cicheński's avatar Mateusz Cicheński Committed by Automerger Merge Worker
Browse files

Reparent PiP overlay under task as soon as possible am: 357f6827

parents 8fb793c1 357f6827
Loading
Loading
Loading
Loading
+15 −5
Original line number Diff line number Diff line
@@ -1530,6 +1530,21 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
                if (mSwipePipToHomeReleaseCheck != null) {
                    mSwipePipToHomeReleaseCheck.setCanRelease(false);
                }

                // grab a screenshot before the PipContentOverlay gets parented on top of the task
                UI_HELPER_EXECUTOR.execute(() -> {
                    final int taskId = mGestureState.getRunningTaskId();
                    mTaskSnapshotCache.put(taskId,
                            mRecentsAnimationController.screenshotTask(taskId));
                });

                // let SystemUi reparent the overlay leash as soon as possible
                SystemUiProxy.INSTANCE.get(mContext).stopSwipePipToHome(
                        mSwipePipToHomeAnimator.getTaskId(),
                        mSwipePipToHomeAnimator.getComponentName(),
                        mSwipePipToHomeAnimator.getDestinationBounds(),
                        mSwipePipToHomeAnimator.getContentOverlay());

                windowAnim = mSwipePipToHomeAnimators;
            } else {
                mSwipePipToHomeAnimator = null;
@@ -2108,11 +2123,6 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
     */
    private void maybeFinishSwipePipToHome() {
        if (mIsSwipingPipToHome && mSwipePipToHomeAnimators[0] != null) {
            SystemUiProxy.INSTANCE.get(mContext).stopSwipePipToHome(
                    mSwipePipToHomeAnimator.getTaskId(),
                    mSwipePipToHomeAnimator.getComponentName(),
                    mSwipePipToHomeAnimator.getDestinationBounds(),
                    mSwipePipToHomeAnimator.getContentOverlay());
            mRecentsAnimationController.setFinishTaskTransaction(
                    mSwipePipToHomeAnimator.getTaskId(),
                    mSwipePipToHomeAnimator.getFinishTransaction(),
+3 −3
Original line number Diff line number Diff line
@@ -563,9 +563,9 @@ public class SystemUiProxy implements ISystemUiProxy {
    }

    /**
     * Notifies WM Shell that launcher has finished all the animation for swipe to home. WM Shell
     * can choose to fade out the overlay when entering PIP is finished, and WM Shell should be
     * responsible for cleaning up the overlay.
     * Notifies WM Shell that launcher has finished the preparation of the animation for swipe to
     * home. WM Shell can choose to fade out the overlay when entering PIP is finished, and WM Shell
     * should be responsible for cleaning up the overlay.
     */
    public void stopSwipePipToHome(int taskId, ComponentName componentName, Rect destinationBounds,
            SurfaceControl overlay) {