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

Commit 0edb09d6 authored by Louis Chang's avatar Louis Chang Committed by Android (Google) Code Review
Browse files

Merge "Set the Task policy to launch-next-to-bubble if requested to" into main

parents fd24d1ec 476a1203
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -1772,6 +1772,27 @@ class ActivityStarter {
            startedActivityRootTask.setAlwaysOnTop(true);
        }

        // TODO(b/388651207): the state should be reset if the Task is no longer in bubble.
        if (com.android.wm.shell.Flags.enableCreateAnyBubble()) {
            // Sets the launch-next-to-bubble policy if requested
            if (options != null && options.getLaunchNextToBubble()) {
                startedActivityRootTask.mLaunchNextToBubble = true;
            }

            // Propagate the launch-next-to-bubble policy from the source Task if any
            if (mSourceRecord != null && mSourceRecord.getTask().mLaunchNextToBubble) {
                startedActivityRootTask.mLaunchNextToBubble = true;

                // Also propagate the windowingMode and bounds if not set.
                if (options == null || (options.getLaunchWindowingMode() == WINDOWING_MODE_UNDEFINED
                        && options.getLaunchBounds() == null)) {
                    final Task sourceTask = mSourceRecord.getTask();
                    startedActivityRootTask.setWindowingMode(sourceTask.getWindowingMode());
                    startedActivityRootTask.setBounds(sourceTask.getBounds());
                }
            }
        }

        if (isIndependentLaunch && !mDoResume && avoidMoveToFront() && !mTransientLaunch
                && !started.shouldBeVisible(true /* ignoringKeyguard */)) {
            Slog.i(TAG, "Abort " + transition + " of invisible launch " + started);
+9 −0
Original line number Diff line number Diff line
@@ -304,6 +304,12 @@ class Task extends TaskFragment {
     */
    boolean mIsEffectivelySystemApp;

    /**
     * Whether the new Tasks that are started from this Task should be a Bubble.
     * Note: this should be migrated to a more hierarchical approach in the long-term.
     */
    boolean mLaunchNextToBubble;

    int mCurrentUser;

    String affinity;        // The affinity name for this task, or null; may change identity.
@@ -5960,6 +5966,9 @@ class Task extends TaskFragment {
                        + " mOffsetYForInsets=" + mOffsetYForInsets);
            }
        }
        if (mLaunchNextToBubble) {
            pw.println(prefix + "  mLaunchNextToBubble=true");
        }
        if (mLastNonFullscreenBounds != null) {
            pw.print(prefix); pw.print("  mLastNonFullscreenBounds=");
            pw.println(mLastNonFullscreenBounds);
+6 −0
Original line number Diff line number Diff line
@@ -3414,6 +3414,12 @@ class TaskFragment extends WindowContainer<WindowContainer> {
        if (!bounds.isEmpty()) {
            pw.println(prefix + "  mBounds=" + bounds);
        }
        if (isForceHidden()) {
            pw.println(prefix + "  mForceHiddenFlags=" + mForceHiddenFlags);
        }
        if (isAlwaysOnTop()) {
            pw.println(prefix + "  isAlwaysOnTop");
        }
        if (mIsRemovalRequested) {
            pw.println(prefix + "  mIsRemovalRequested=true");
        }