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

Commit 74b3e882 authored by Liran Binyamin's avatar Liran Binyamin
Browse files

Defer showing the expanded view for bubble bar

This change defers showing the expanded view for the bubble bar
until launcher requests it.

Flag: com.android.wm.shell.enable_bubble_bar
Fixes: 339683389
Test: manual
      - add new bubble that auto expands
      - observe expanded view shows when bubble bar starts expanding
Change-Id: I3f1f48a469b9c5c75ff2cae334d5c3c4edb65e9f
parent ebf8e0c8
Loading
Loading
Loading
Loading
+20 −9
Original line number Diff line number Diff line
@@ -1997,15 +1997,10 @@ public class BubbleController implements ConfigurationChangeListener,

        @Override
        public void expansionChanged(boolean isExpanded) {
            if (mLayerView != null) {
                if (!isExpanded) {
            // in bubble bar mode, let the request to show the expanded view come from launcher.
            // only collapse here if we're collapsing.
            if (mLayerView != null && !isExpanded) {
                mLayerView.collapse();
                } else {
                    BubbleViewProvider selectedBubble = mBubbleData.getSelectedBubble();
                    if (selectedBubble != null) {
                        mLayerView.showExpandedView(selectedBubble);
                    }
                }
            }
        }

@@ -2151,6 +2146,13 @@ public class BubbleController implements ConfigurationChangeListener,
        }
    };

    private void showExpandedViewForBubbleBar() {
        BubbleViewProvider selectedBubble = mBubbleData.getSelectedBubble();
        if (selectedBubble != null) {
            mLayerView.showExpandedView(selectedBubble);
        }
    }

    private void updateOverflowButtonDot() {
        BubbleOverflow overflow = mBubbleData.getOverflow();
        if (overflow == null) return;
@@ -2533,6 +2535,15 @@ public class BubbleController implements ConfigurationChangeListener,
                if (mLayerView != null) mLayerView.updateExpandedView();
            });
        }

        @Override
        public void showExpandedView() {
            mMainExecutor.execute(() -> {
                if (mLayerView != null) {
                    showExpandedViewForBubbleBar();
                }
            });
        }
    }

    private class BubblesImpl implements Bubbles {
+2 −0
Original line number Diff line number Diff line
@@ -53,4 +53,6 @@ interface IBubbles {
    oneway void showShortcutBubble(in ShortcutInfo info) = 12;

    oneway void showAppBubble(in Intent intent) = 13;

    oneway void showExpandedView() = 14;
}
 No newline at end of file