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

Commit d1c9b447 authored by mpodolian's avatar mpodolian
Browse files

Checked bubble bar expanded view is null and early return.

Added additional protologs for setting and removing bubble`s bubble bar
expanded view.

Fixes: 434847555
Flag: com.android.wm.shell.enable_bubble_bar
Test: Manual. Checked protolog output matches introduced changes.
Change-Id: Ic64cb4341f500f047e542c43991046ea5349fdbf
parent c4063535
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);