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

Commit 95a5f05c authored by Liran Binyamin's avatar Liran Binyamin
Browse files

Reset bubbles expanded state after folding

This change is a temporary solution to prevent
crashing after folding the device with an expanded
bubble. A proper fix would be to create a shell
transition to convert the expanded bar bubble to a
floating bubble.

Bug: 380105874
Flag: com.android.wm.shell.enable_bubble_bar
Test: manual
       - unfold device
       - create bubble and expand it
       - fold device
       - tap the stack and observe bubble expanded
       - disable the flag enable_bubble_bar and repeat

Change-Id: Ic431ee73d8b6580c84f5cf6376beff340266b1f0
parent 6bf9f10e
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -2007,7 +2007,9 @@ public class BubbleController implements ConfigurationChangeListener,
                if (mStackView != null) {
                    b.setSuppressFlyout(true);
                    mStackView.addBubble(b);
                    if (b.getKey().equals(mBubbleData.getSelectedBubbleKey())) {
                        mStackView.setSelectedBubble(b);
                    }
                } else {
                    Log.w(TAG, "Tried to add a bubble to the stack but the stack is null");
                }
@@ -2019,6 +2021,11 @@ public class BubbleController implements ConfigurationChangeListener,
                }
            };
        }
        // TODO (b/380105874): Remove this after properly transitioning the expanded bubble from bar
        // to floating
        if (mStackView != null && mBubbleData.isExpanded()) {
            mBubbleData.collapseNoUpdate();
        }
        for (int i = mBubbleData.getBubbles().size() - 1; i >= 0; i--) {
            Bubble bubble = mBubbleData.getBubbles().get(i);
            bubble.inflate(callback,
+5 −0
Original line number Diff line number Diff line
@@ -371,6 +371,11 @@ public class BubbleData {
        dispatchPendingChanges();
    }

    /** Sets the expanded state to false without dispatching changes. */
    public void collapseNoUpdate() {
        mExpanded = false;
    }

    /**
     * Sets the selected bubble and expands it, but doesn't dispatch changes
     * to {@link BubbleData.Listener}. This is used for updates coming from launcher whose views