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

Commit 91b2ab82 authored by Ikram Gabiyev's avatar Ikram Gabiyev
Browse files

Disallow enter PiP when starting a split task

Disallow enter PiP while Launching another task
into one of split stage tasks.

This should also help Core keep
ActivityTaskSupervisor#mUserLeaving as false,
which helps avoid onUserLeaveHint() on client-side
and any legacy enter-PiP requests.

Bug: 336477473
Test: repro the steps in the bug (latest comments)

Change-Id: Idceebc9742f45d17ebe5398df2c151085d33c775
Merged-In: Idceebc9742f45d17ebe5398df2c151085d33c775
(cherry picked from commit c46fae34)
parent 8cadc83b
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1871,8 +1871,14 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
        }
        // Put BAL flags to avoid activity start aborted. Otherwise, flows like shortcut to split
        // will be canceled.
        ActivityOptions options = ActivityOptions.fromBundle(opts);
        opts.putBoolean(KEY_PENDING_INTENT_BACKGROUND_ACTIVITY_ALLOWED, true);
        opts.putBoolean(KEY_PENDING_INTENT_BACKGROUND_ACTIVITY_ALLOWED_BY_PERMISSION, true);

        // TODO (b/336477473): Disallow enter PiP when launching a task in split by default;
        //                     this might have to be changed as more split-to-pip cujs are defined.
        options.setDisallowEnterPictureInPictureWhileLaunching(true);
        opts.putAll(options.toBundle());
    }

    void updateActivityOptions(Bundle opts, @SplitPosition int position) {