diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java index aedd2db738ee0..10b90f28d893a 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java +++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java @@ -1421,6 +1421,18 @@ public class BubbleStackView extends FrameLayout { hideDismissTarget(); } + /** Expands the clicked bubble. */ + public void expandBubble(Bubble bubble) { + if (bubble.equals(mBubbleData.getSelectedBubble())) { + // If the bubble we're supposed to expand is the selected bubble, that means the + // overflow bubble is currently expanded. Don't tell BubbleData to set this bubble as + // selected, since it already is. Just call the stack's setSelectedBubble to expand it. + setSelectedBubble(bubble); + } else { + mBubbleData.setSelectedBubble(bubble); + } + } + void onDragStart() { if (DEBUG_BUBBLE_STACK_VIEW) { Log.d(TAG, "onDragStart()"); diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleTouchHandler.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleTouchHandler.java index 0c5bef4d2bded..132c45fab3d2f 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleTouchHandler.java +++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleTouchHandler.java @@ -189,7 +189,7 @@ class BubbleTouchHandler implements View.OnTouchListener { if (key == BubbleOverflow.KEY) { mStack.showOverflow(); } else { - mBubbleData.setSelectedBubble(mBubbleData.getBubbleWithKey(key)); + mStack.expandBubble(mBubbleData.getBubbleWithKey(key)); } } resetForNextGesture();