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

Commit 19cae5d0 authored by Mady Mellor's avatar Mady Mellor
Browse files

Move the constructor of BubbleTaskViewListener above the listener impl

Also adds some java doc to the class.

Flag: EXEMPT moving code around
Test: treehugger
Bug: 272102927
Change-Id: I05ad1f20da71e83620781a0d6ecb393834f2dd66
parent 88ba9516
Loading
Loading
Loading
Loading
+19 −14
Original line number Diff line number Diff line
@@ -40,6 +40,11 @@ import com.android.internal.protolog.ProtoLog;
import com.android.wm.shell.shared.bubbles.BubbleAnythingFlagHelper;
import com.android.wm.shell.taskview.TaskView;

/**
 * A listener that works with task views for bubbles, manages launching the appropriate
 * content into the task view from the bubble and sends updates of task view events back to
 * the parent view via {@link BubbleTaskViewListener.Callback}.
 */
public class BubbleTaskViewListener implements TaskView.Listener {
    private static final String TAG = BubbleTaskViewListener.class.getSimpleName();

@@ -75,6 +80,20 @@ public class BubbleTaskViewListener implements TaskView.Listener {
    private boolean mInitialized = false;
    private boolean mDestroyed = false;

    public BubbleTaskViewListener(Context context, BubbleTaskView bubbleTaskView, View parentView,
            BubbleExpandedViewManager manager, BubbleTaskViewListener.Callback callback) {
        mContext = context;
        mTaskView = bubbleTaskView.getTaskView();
        mParentView = parentView;
        mExpandedViewManager = manager;
        mCallback = callback;
        bubbleTaskView.setDelegateListener(this);
        if (bubbleTaskView.isCreated()) {
            mTaskId = bubbleTaskView.getTaskId();
            callback.onTaskCreated();
        }
    }

    @Override
    public void onInitialized() {
        ProtoLog.d(WM_SHELL_BUBBLES, "onInitialized: destroyed=%b initialized=%b bubble=%s",
@@ -207,20 +226,6 @@ public class BubbleTaskViewListener implements TaskView.Listener {
        }
    }

    public BubbleTaskViewListener(Context context, BubbleTaskView bubbleTaskView, View parentView,
            BubbleExpandedViewManager manager, BubbleTaskViewListener.Callback callback) {
        mContext = context;
        mTaskView = bubbleTaskView.getTaskView();
        mParentView = parentView;
        mExpandedViewManager = manager;
        mCallback = callback;
        bubbleTaskView.setDelegateListener(this);
        if (bubbleTaskView.isCreated()) {
            mTaskId = bubbleTaskView.getTaskId();
            callback.onTaskCreated();
        }
    }

    /**
     * Sets the bubble or updates the bubble used to populate the view.
     *