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

Commit b42b8f83 authored by Evan Rosky's avatar Evan Rosky Committed by Automerger Merge Worker
Browse files

Merge "Disable PiP entry when switching tasks via recents" into tm-dev am: ffdd9002

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16942742

Change-Id: Ibfa4ef3e5b0634f7ce9557a5bf58512f560c0ec4
parents 5c79dcbf ffdd9002
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -5149,10 +5149,13 @@ class Task extends TaskFragment {
            // Ensure that we do not trigger entering PiP an activity on the root pinned task
            return false;
        }
        final boolean isTransient = opts != null && opts.getTransientLaunch();
        final Task targetRootTask = toFrontTask != null
                ? toFrontTask.getRootTask() : toFrontActivity.getRootTask();
        if (targetRootTask != null && targetRootTask.isActivityTypeAssistant()) {
            // Ensure the task/activity being brought forward is not the assistant
        if (targetRootTask != null && (targetRootTask.isActivityTypeAssistant() || isTransient)) {
            // Ensure the task/activity being brought forward is not the assistant and is not
            // transient. In the case of transient-launch, we want to wait until the end of the
            // transition and only allow switch if the transient launch was committed.
            return false;
        }
        return true;
+11 −1
Original line number Diff line number Diff line
@@ -459,9 +459,19 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe
                // activity in a bad state.
                if (!visibleAtTransitionEnd && !ar.isVisibleRequested()) {
                    boolean commitVisibility = true;
                    if (ar.getDeferHidingClient() && ar.getTask() != null) {
                    if (ar.isVisible() && ar.getTask() != null) {
                        if (ar.pictureInPictureArgs != null
                                && ar.pictureInPictureArgs.isAutoEnterEnabled()) {
                            if (mTransientLaunches != null) {
                                for (int j = 0; j < mTransientLaunches.size(); ++j) {
                                    if (mTransientLaunches.valueAt(j).isVisibleRequested()) {
                                        // force enable pip-on-task-switch now that we've committed
                                        // to actually launching to the transient activity.
                                        ar.supportsEnterPipOnTaskSwitch = true;
                                        break;
                                    }
                                }
                            }
                            mController.mAtm.enterPictureInPictureMode(ar, ar.pictureInPictureArgs);
                            // Avoid commit visibility to false here, or else we will get a sudden
                            // "flash" / surface going invisible for a split second.