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

Commit fed9edc1 authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "1/ Fix some issues with launching apps with trampoline tasks" into main

parents 734cab3e e5cded64
Loading
Loading
Loading
Loading
+19 −2
Original line number Diff line number Diff line
@@ -145,6 +145,13 @@ public class BubbleTransitions {
        }
        for (IBinder cookie : info.getTriggerTask().launchCookies) {
            if (mPendingEnterTransitions.containsKey(cookie)) {
                if (mBubbleData.hasAnyBubbleWithKey(Bubble.getAppBubbleKeyForTask(
                        info.getTriggerTask()))) {
                    // We'll let this transition fall through and let the normal TaskViewTransitions
                    // play it
                    mPendingEnterTransitions.remove(cookie);
                    return false;
                }
                return true;
            }
        }
@@ -530,6 +537,10 @@ public class BubbleTransitions {
            mTransition = null;
        }

        /**
         * @return true As DefaultMixedTransition assumes that this transition will be handled by
         * this handler in all cases.
         */
        @Override
        public boolean startAnimation(@NonNull IBinder transition,
                @NonNull TransitionInfo info,
@@ -570,7 +581,8 @@ public class BubbleTransitions {
                        + "one, cleaning up the task view");
                mBubble.getTaskView().getController().setTaskNotFound();
                mTaskViewTransitions.onExternalDone(mTransition);
                return false;
                finishCallback.onTransitionFinished(null /* finishWct */);
                return true;
            }
            mFinishCb = finishCallback;

@@ -827,6 +839,10 @@ public class BubbleTransitions {
            mEnterTransitions.remove(transition);
        }

        /**
         * @return true As DefaultMixedTransition assumes that this transition will be handled by
         * this handler in all cases.
         */
        @Override
        public boolean startAnimation(@NonNull IBinder transition,
                @NonNull TransitionInfo info,
@@ -867,7 +883,8 @@ public class BubbleTransitions {
                        + "one, cleaning up the task view");
                mBubble.getTaskView().getController().setTaskNotFound();
                mTaskViewTransitions.onExternalDone(mTransition);
                return false;
                finishCallback.onTransitionFinished(null /* finishWct */);
                return true;
            }
            mFinishCb = finishCallback;

+13 −2
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
package com.android.wm.shell.bubbles;

import static android.app.ActivityTaskManager.INVALID_TASK_ID;
import static com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_BUBBLES_NOISY;

import android.app.ActivityManager;
import android.os.IBinder;
@@ -24,7 +25,9 @@ import android.window.TransitionInfo;

import androidx.annotation.NonNull;

import com.android.internal.protolog.ProtoLog;
import com.android.wm.shell.shared.TransitionUtil;
import com.android.wm.shell.shared.bubbles.BubbleAnythingFlagHelper;
import com.android.wm.shell.transition.Transitions;

/**
@@ -60,17 +63,25 @@ public class BubblesTransitionObserver implements Transitions.TransitionObserver
                continue;
            }
            final int expandedId = mBubbleData.getSelectedBubble().getTaskId();
            // If the task id that's opening is the same as the expanded bubble, skip collapsing
            // If the opening task id is the same as the expanded bubble, skip collapsing
            // because it is our bubble that is opening.
            if (expandedId == INVALID_TASK_ID || expandedId == taskInfo.taskId) {
                continue;
            }
            // If the task is opening on a different display, skip collapsing because the task
            // If the opening task is on a different display, skip collapsing because the task
            // opening does not visually overlap with the bubbles.
            final int bubbleViewDisplayId = mBubbleController.getCurrentViewDisplayId();
            if (taskInfo.displayId != bubbleViewDisplayId) {
                continue;
            }
            // 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) {
                ProtoLog.d(WM_SHELL_BUBBLES_NOISY,
                        "TransitionObserver.onTransitionReady(): skipping app bubble for taskId=%d",
                        taskInfo.taskId);
                continue;
            }
            mBubbleData.setExpanded(false);
        }
    }