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

Commit 8f232362 authored by Luca Zuccarini's avatar Luca Zuccarini Committed by Android (Google) Code Review
Browse files

Merge "Dismiss PiP without bespoke animation when it is not visible." into main

parents c35494f1 bf3b6185
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -312,3 +312,13 @@ flag {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "dismiss_pip_from_lockscreen"
    namespace: "multitasking"
    description: "Fixes a bug where tapping on a notification for a PiP-ed app while on Lockscreen does not launch it in fullscreen."
    bug: "373314569"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}
+2 −1
Original line number Diff line number Diff line
@@ -144,7 +144,8 @@ public abstract class PipTransitionController implements Transitions.TransitionH
    /**
     * Called when the Shell wants to start an exit-via-expand from Pip transition/animation.
     */
    public void startExpandTransition(WindowContainerTransaction wct, boolean toSplit) {
    public void startExpandTransition(
            WindowContainerTransaction wct, boolean toSplit, boolean hasFirstHandler) {
        // Default implementation does nothing.
    }

+3 −2
Original line number Diff line number Diff line
@@ -290,10 +290,11 @@ public class PipController implements ConfigurationChangeListener,
                ProtoLog.d(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE,
                        "onActivityRestartAttempt: topActivity=%s, wasVisible=%b",
                        task.topActivity, wasVisible);
                if (task.getWindowingMode() != WINDOWING_MODE_PINNED || !wasVisible) {
                boolean keepPipFromLockscreen = !wasVisible && !Flags.dismissPipFromLockscreen();
                if (task.getWindowingMode() != WINDOWING_MODE_PINNED || keepPipFromLockscreen) {
                    return;
                }
                mPipScheduler.scheduleExitPipViaExpand();
                mPipScheduler.scheduleExitPipViaExpand(wasVisible);
            }
        });

+1 −1
Original line number Diff line number Diff line
@@ -365,7 +365,7 @@ public class PipMotionHelper implements PipAppOpsListener.Callback,
        if (PipUtils.isContentPip(mPipTransitionState.getPipTaskInfo())) {
            mPipScheduler.scheduleRemovePip(true /* withFadeout */);
        } else {
            mPipScheduler.scheduleExitPipViaExpand();
            mPipScheduler.scheduleExitPipViaExpand(true /* wasVisible */);
        }
    }

+2 −2
Original line number Diff line number Diff line
@@ -169,7 +169,7 @@ public class PipScheduler implements PipTransitionState.PipTransitionStateChange
    /**
     * Schedules exit PiP via expand transition.
     */
    public void scheduleExitPipViaExpand() {
    public void scheduleExitPipViaExpand(boolean wasVisible) {
        mMainExecutor.execute(() -> {
            if (!mPipTransitionState.isInPip()) return;

@@ -187,7 +187,7 @@ public class PipScheduler implements PipTransitionState.PipTransitionStateChange
            });
            boolean toSplit = !wct.isEmpty();
            wct.merge(expandWct, true /* transfer */);
            mPipTransitionController.startExpandTransition(wct, toSplit);
            mPipTransitionController.startExpandTransition(wct, toSplit, wasVisible);
        });
    }

Loading