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

Commit 3f2aec11 authored by Mykola Podolian's avatar Mykola Podolian Committed by Android (Google) Code Review
Browse files

Merge "Checked bubble bar expanded view is null and early return." into main

parents 5dadecdf d1c9b447
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -672,7 +672,6 @@ public class Bubble implements BubbleViewProvider {
     * Call when all the views should be removed/cleaned up.
     */
    public void cleanupViews() {
        ProtoLog.d(WM_SHELL_BUBBLES, "Bubble#cleanupViews=%s", getKey());
        cleanupViews(true);
    }

@@ -683,6 +682,8 @@ public class Bubble implements BubbleViewProvider {
     * {@code cleanupTaskView} to avoid recreating it in the new mode.
     */
    public void cleanupViews(boolean cleanupTaskView) {
        ProtoLog.d(WM_SHELL_BUBBLES, "Bubble#cleanupViews=%s cleanupTaskView=%b", getKey(),
                cleanupTaskView);
        cleanupExpandedView(cleanupTaskView);
        mIconView = null;
    }
@@ -789,6 +790,8 @@ public class Bubble implements BubbleViewProvider {
        if (!isInflated()) {
            mIconView = info.imageView;
            mExpandedView = info.expandedView;
            ProtoLog.d(WM_SHELL_BUBBLES, "Bubble#setViewInfo %s setting expanded view to %s",
                    mKey, info.bubbleBarExpandedView);
            mBubbleBarExpandedView = info.bubbleBarExpandedView;
        }

+8 −3
Original line number Diff line number Diff line
@@ -1784,6 +1784,13 @@ public class BubbleTransitions {
            final SurfaceControl taskViewSurface = mBubble.getTaskView().getSurfaceControl();
            final TaskViewRepository.TaskViewState state = mRepository.byTaskView(tvc);
            if (state == null) return;
            final View bubbleBarExpandedView = mBubble.getBubbleBarExpandedView();
            if (bubbleBarExpandedView == null) {
                ProtoLog.e(WM_SHELL_BUBBLES,
                        "BubbleTransition#updateBubbleTask %s bubbleBarExpandedView is null",
                        mBubble.getKey());
                return;
            }
            state.mVisible = true;
            state.mBounds.set(mBounds);
            final SurfaceControl.Transaction startT = mTransactionProvider.get();
@@ -1791,9 +1798,7 @@ public class BubbleTransitions {
            // since the task view is switching windows, its surface needs to be moved over to the
            // new bubble window surface
            startT.reparent(taskViewSurface,
                    mBubble.getBubbleBarExpandedView()
                            .getViewRootImpl()
                            .updateAndGetBoundsLayer(startT));
                    bubbleBarExpandedView.getViewRootImpl().updateAndGetBoundsLayer(startT));

            startT.reparent(mTaskLeash, taskViewSurface);
            startT.setPosition(mTaskLeash, 0, 0);