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

Commit 45db0112 authored by Wei Sheng Shih's avatar Wei Sheng Shih Committed by Automerger Merge Worker
Browse files

Merge "Revert^2 Do not enter pip during transient launch" into udc-qpr-dev am: 05b23f1e

parents e8a99bb8 05b23f1e
Loading
Loading
Loading
Loading
+12 −8
Original line number Diff line number Diff line
@@ -5255,17 +5255,21 @@ class Task extends TaskFragment {
            // Ensure that we do not trigger entering PiP an activity on the root pinned task.
            return;
        }
        final boolean isTransient = opts != null && opts.getTransientLaunch();
        final Task targetRootTask = toFrontTask != null
                ? toFrontTask.getRootTask() : toFrontActivity.getRootTask();
        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.
        final Task targetRootTask = toFrontTask != null ? toFrontTask.getRootTask()
                : toFrontActivity != null ? toFrontActivity.getRootTask() : null;
        if (targetRootTask == null) {
            Slog.e(TAG, "No root task for enter pip, both to front task and activity are null?");
            return;
        }
        pipCandidate.supportsEnterPipOnTaskSwitch = true;
        final boolean isTransient = opts != null && opts.getTransientLaunch()
                || (targetRootTask.mTransitionController.isTransientHide(targetRootTask));

        // Ensure the task/activity being brought forward is not the assistant and is not transient
        // nor transient hide target. In the case of transient-launch, we want to wait until the end
        // of the transition and only allow to enter pip on task switch after the transient launch
        // was committed.
        pipCandidate.supportsEnterPipOnTaskSwitch = !targetRootTask.isActivityTypeAssistant()
                && !isTransient;
    }

    /**