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

Commit f8b2f6f7 authored by Louis Chang's avatar Louis Chang
Browse files

Determine the app bubbles by checking the organized parent taskId

Bug: 407669465
Test: wm presubmit
Test: start an app into bubble
Flag: com.android.window.flags.root_task_for_bubble
Change-Id: I82cfb6fb17460ca65500e03dee06cdaeee9957cb
parent 8ae2f4fc
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -362,6 +362,8 @@ public class TaskInfo {
     * Please use this with caution. This is just a short-term solution which should be migrated
     * to a more generic model vs. implying the Task is an App Bubble here.
     * @hide
     *
     * TODO(b/407669465): remove it once migrated to the new approach
     */
    public boolean isAppBubble;

+9 −0
Original line number Diff line number Diff line
@@ -1431,6 +1431,15 @@ public class BubbleController implements ConfigurationChangeListener,
        return bubble != null && bubble.getPreparingTransition() == null;
    }

    /** Returns whether the given task should be an App Bubble */
    public boolean shouldBeAppBubble(@NonNull ActivityManager.RunningTaskInfo taskInfo) {
        if (com.android.window.flags.Flags.rootTaskForBubble()) {
            return mAppBubbleRootTaskInfo != null
                    && taskInfo.parentTaskId == mAppBubbleRootTaskInfo.taskId;
        }
        return taskInfo.isAppBubble;
    }

    public boolean isStackExpanded() {
        return mBubbleData.isExpanded();
    }
+7 −0
Original line number Diff line number Diff line
@@ -130,6 +130,13 @@ public class BubbleTransitions {
        mBubbleController = controller;
    }

    /**
     * Returns whether the given Task should be an App Bubble.
     */
    public boolean shouldBeAppBubble(@NonNull ActivityManager.RunningTaskInfo taskInfo) {
        return mBubbleController.shouldBeAppBubble(taskInfo);
    }

    /**
     * Returns whether bubbles are showing as the bubble bar.
     */
+2 −1
Original line number Diff line number Diff line
@@ -92,7 +92,8 @@ public class BubblesTransitionObserver implements Transitions.TransitionObserver
            }
            // If the opening task was launched by another bubble, skip collapsing the existing one
            // since BubbleTransitions will start a new bubble for it
            if (BubbleAnythingFlagHelper.enableCreateAnyBubble() && taskInfo.isAppBubble) {
            if (BubbleAnythingFlagHelper.enableCreateAnyBubble()
                    && mBubbleController.shouldBeAppBubble(taskInfo)) {
                ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "TransitionObserver.onTransitionReady(): "
                        + "skipping app bubble for taskId=%d", taskInfo.taskId);
                continue;
+1 −1
Original line number Diff line number Diff line
@@ -811,7 +811,7 @@ public class DefaultMixedHandler implements MixedTransitionHandler,
    public boolean requestHasBubbleEnterFromAppBubble(@NonNull TransitionRequestInfo request) {
        return BubbleAnythingFlagHelper.enableCreateAnyBubble()
                && request.getTriggerTask() != null
                && request.getTriggerTask().isAppBubble
                && mBubbleTransitions.shouldBeAppBubble(request.getTriggerTask())
                && !mBubbleTransitions.hasBubbleWithTaskId(request.getTriggerTask().taskId)
                // TODO(b/408453889): To be removed once we handle transitions with stack view
                && mBubbleTransitions.isShowingAsBubbleBar();
Loading