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

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

Merge "Making the Bubble task to continue launch next as bubble" into main

parents 154cf271 89454f6c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -368,8 +368,8 @@ public class BubbleController implements ConfigurationChangeListener,
        mDisplayController = displayController;
        final TaskViewTransitions tvTransitions;
        if (TaskViewTransitions.useRepo()) {
            tvTransitions = new TaskViewTransitions(transitions, taskViewRepository, organizer,
                    syncQueue);
            tvTransitions = new BubbleTaskViewTransitions(transitions, taskViewRepository,
                    organizer, syncQueue);
        } else {
            tvTransitions = taskViewTransitions;
        }
+2 −0
Original line number Diff line number Diff line
@@ -249,6 +249,7 @@ public class BubbleExpandedView extends LinearLayout {
                                // Needs to be mutable for the fillInIntent
                                PendingIntent.FLAG_MUTABLE | PendingIntent.FLAG_UPDATE_CURRENT,
                                /* options= */ null);
                        options.setLaunchNextToBubble(true);
                        mTaskView.startActivity(pi, fillInIntent, options, launchBounds);
                    } else if (!mIsOverflow && isShortcutBubble) {
                        ProtoLog.v(WM_SHELL_BUBBLES, "startingShortcutBubble=%s", getBubbleKey());
@@ -256,6 +257,7 @@ public class BubbleExpandedView extends LinearLayout {
                            options.setLaunchedFromBubble(true);
                            options.setApplyActivityFlagsForBubbles(true);
                        } else {
                            options.setLaunchNextToBubble(true);
                            options.setApplyMultipleTaskFlagForShortcut(true);
                        }
                        mTaskView.startShortcutActivity(mBubble.getShortcutInfo(),
+2 −0
Original line number Diff line number Diff line
@@ -144,12 +144,14 @@ public class BubbleTaskViewListener implements TaskView.Listener {
                                PendingIntent.FLAG_MUTABLE | PendingIntent.FLAG_UPDATE_CURRENT,
                                /* options= */ null);
                    }
                    options.setLaunchNextToBubble(true);
                    mTaskView.startActivity(pi, fillInIntent, options, launchBounds);
                } else if (isShortcutBubble) {
                    if (mBubble.isChat()) {
                        options.setLaunchedFromBubble(true);
                        options.setApplyActivityFlagsForBubbles(true);
                    } else {
                        options.setLaunchNextToBubble(true);
                        options.setApplyMultipleTaskFlagForShortcut(true);
                    }
                    mTaskView.startShortcutActivity(mBubble.getShortcutInfo(),
+48 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2025 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.wm.shell.bubbles;

import android.app.ActivityManager;
import android.view.SurfaceControl;
import android.window.WindowContainerTransaction;

import com.android.wm.shell.ShellTaskOrganizer;
import com.android.wm.shell.common.SyncTransactionQueue;
import com.android.wm.shell.taskview.TaskViewRepository;
import com.android.wm.shell.taskview.TaskViewTaskController;
import com.android.wm.shell.taskview.TaskViewTransitions;
import com.android.wm.shell.transition.Transitions;

public class BubbleTaskViewTransitions extends TaskViewTransitions {

    public BubbleTaskViewTransitions(Transitions transitions, TaskViewRepository repository,
            ShellTaskOrganizer taskOrganizer, SyncTransactionQueue syncQueue) {
        super(transitions, repository, taskOrganizer, syncQueue);
    }

    @Override
    public void prepareOpenAnimation(TaskViewTaskController taskView, boolean newTask,
            SurfaceControl.Transaction startTransaction,
            SurfaceControl.Transaction finishTransaction, ActivityManager.RunningTaskInfo taskInfo,
            SurfaceControl leash, WindowContainerTransaction wct) {
        if (!taskInfo.getConfiguration().windowConfiguration.isAlwaysOnTop()) {
            wct.setAlwaysOnTop(taskInfo.token, true /* alwaysOnTop */);
        }
        super.prepareOpenAnimation(taskView, newTask, startTransaction, finishTransaction, taskInfo,
                leash, wct);
    }
}