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

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

Merge "Preparation for selecting a bubble for an ongoing transition" into main

parents 76530055 531f1c44
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -370,10 +370,16 @@ public class ShellTaskOrganizer extends TaskOrganizer {
    public void addListenerForTaskId(TaskListener listener, int taskId) {
        synchronized (mLock) {
            ProtoLog.v(WM_SHELL_TASK_ORG, "addListenerForTaskId taskId=%s", taskId);
            if (mTaskListeners.get(taskId) != null) {
            final TaskListener existingListener = mTaskListeners.get(taskId);
            if (existingListener != null) {
                if (existingListener == listener) {
                    // Same listener already registered
                    return;
                } else {
                    throw new IllegalArgumentException(
                            "Listener for taskId=" + taskId + " already exists");
                }
            }

            final TaskAppearedInfo info = mTasks.get(taskId);
            if (info == null) {
+4 −0
Original line number Diff line number Diff line
@@ -62,6 +62,10 @@ class BubbleTaskView(val taskView: TaskView, executor: Executor) {
            delegateListener?.onInitialized()
        }

        override fun onSurfaceAlreadyCreated() {
            delegateListener?.onSurfaceAlreadyCreated()
        }

        override fun onReleased() {
            delegateListener?.onReleased()
        }
+8 −0
Original line number Diff line number Diff line
@@ -197,6 +197,14 @@ public class BubbleTaskViewListener implements TaskView.Listener {
        });
    }

    @Override
    public void onSurfaceAlreadyCreated() {
        ProtoLog.d(WM_SHELL_BUBBLES, "onSurfaceCreated: bubble=%s", getBubbleKey());
        if (mBubble.getPreparingTransition() != null) {
            mBubble.getPreparingTransition().surfaceCreated();
        }
    }

    @Override
    public void onReleased() {
        mDestroyed = true;
+2 −0
Original line number Diff line number Diff line
@@ -99,6 +99,8 @@ public class BubblesTransitionObserver implements Transitions.TransitionObserver
                continue;
            }

            ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "TransitionObserver.onTransitionReady(): "
                    + "collapsing bubble for taskId=%d", taskInfo.taskId);
            mBubbleData.setExpanded(false);
            return;
        }
+6 −0
Original line number Diff line number Diff line
@@ -55,6 +55,12 @@ public class TaskView extends SurfaceView implements SurfaceHolder.Callback,
         */
        default void onInitialized() {}

        /**
         * Only called when the surface has been created, and the task view has already been
         * initialized (and onInitialized has been called)
         */
        default void onSurfaceAlreadyCreated() {}

        /** Called when the container can no longer launch activities. */
        default void onReleased() {}

Loading