Merge "Revert "Do not show overflow after the last bubble dismissed (in master).""

This commit is contained in:
Michał Brzeziński
2021-12-09 14:53:48 +00:00
committed by Android (Google) Code Review
2 changed files with 13 additions and 6 deletions

View File

@@ -561,10 +561,17 @@ public class BubbleData {
overflowBubble(reason, bubbleToRemove);
if (mBubbles.size() == 1) {
setExpandedInternal(false);
// Don't use setSelectedBubbleInternal because we don't want to trigger an
// applyUpdate
mSelectedBubble = null;
if (hasOverflowBubbles() && (mPositioner.showingInTaskbar() || isExpanded())) {
// No more active bubbles but we have stuff in the overflow -- select that view
// if we're already expanded or always showing.
setShowingOverflow(true);
setSelectedBubbleInternal(mOverflow);
} else {
setExpandedInternal(false);
// Don't use setSelectedBubbleInternal because we don't want to trigger an
// applyUpdate
mSelectedBubble = null;
}
}
if (indexToRemove < mBubbles.size() - 1) {
// Removing anything but the last bubble means positions will change.

View File

@@ -793,7 +793,7 @@ public class BubbleDataTest extends ShellTestCase {
}
@Test
public void test_expanded_removeLastBubble_collapsesIfOverflowNotEmpty() {
public void test_expanded_removeLastBubble_showsOverflowIfNotEmpty() {
// Setup
sendUpdatedEntryAtTime(mEntryA1, 1000);
changeExpandedStateAtTime(true, 2000);
@@ -803,7 +803,7 @@ public class BubbleDataTest extends ShellTestCase {
mBubbleData.dismissBubbleWithKey(mEntryA1.getKey(), Bubbles.DISMISS_USER_GESTURE);
verifyUpdateReceived();
assertThat(mBubbleData.getOverflowBubbles().size()).isGreaterThan(0);
assertExpandedChangedTo(false);
assertSelectionChangedTo(mBubbleData.getOverflow());
}
@Test