Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleData.java +4 −11 Original line number Diff line number Diff line Loading @@ -562,18 +562,11 @@ public class BubbleData { overflowBubble(reason, bubbleToRemove); if (mBubbles.size() == 1) { 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. mStateChange.orderChanged = true; Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/BubbleDataTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -794,7 +794,7 @@ public class BubbleDataTest extends ShellTestCase { } @Test public void test_expanded_removeLastBubble_showsOverflowIfNotEmpty() { public void test_expanded_removeLastBubble_collapsesIfOverflowNotEmpty() { // Setup sendUpdatedEntryAtTime(mEntryA1, 1000); changeExpandedStateAtTime(true, 2000); Loading @@ -804,7 +804,7 @@ public class BubbleDataTest extends ShellTestCase { mBubbleData.dismissBubbleWithKey(mEntryA1.getKey(), Bubbles.DISMISS_USER_GESTURE); verifyUpdateReceived(); assertThat(mBubbleData.getOverflowBubbles().size()).isGreaterThan(0); assertSelectionChangedTo(mBubbleData.getOverflow()); assertExpandedChangedTo(false); } @Test Loading packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java +5 −7 Original line number Diff line number Diff line Loading @@ -116,7 +116,6 @@ import com.android.wm.shell.bubbles.BubbleDataRepository; import com.android.wm.shell.bubbles.BubbleEntry; import com.android.wm.shell.bubbles.BubbleIconFactory; import com.android.wm.shell.bubbles.BubbleLogger; import com.android.wm.shell.bubbles.BubbleOverflow; import com.android.wm.shell.bubbles.BubbleStackView; import com.android.wm.shell.bubbles.BubbleViewInfoTask; import com.android.wm.shell.bubbles.Bubbles; Loading Loading @@ -631,7 +630,7 @@ public class BubblesTest extends SysuiTestCase { } @Test public void testRemoveLastExpanded_selectsOverflow() { public void testRemoveLastExpanded_collapses() { // Mark it as a bubble and add it explicitly mEntryListener.onPendingEntryAdded(mRow); mEntryListener.onPendingEntryAdded(mRow2); Loading Loading @@ -670,11 +669,10 @@ public class BubblesTest extends SysuiTestCase { stackView.getExpandedBubble().getKey()).getKey(), Bubbles.DISMISS_USER_GESTURE); // Overflow should be selected assertEquals(mBubbleData.getSelectedBubble().getKey(), BubbleOverflow.KEY); verify(mBubbleExpandListener).onBubbleExpandChanged(true, BubbleOverflow.KEY); assertTrue(mBubbleController.hasBubbles()); assertSysuiStates(true /* stackExpanded */, false /* mangeMenuExpanded */); // We should be collapsed verify(mBubbleExpandListener).onBubbleExpandChanged(false, mRow.getKey()); assertFalse(mBubbleController.hasBubbles()); assertSysuiStates(false /* stackExpanded */, false /* mangeMenuExpanded */); } @Test Loading packages/SystemUI/tests/src/com/android/systemui/wmshell/NewNotifPipelineBubblesTest.java +8 −7 Original line number Diff line number Diff line Loading @@ -19,8 +19,11 @@ package com.android.systemui.wmshell; import static android.app.Notification.FLAG_BUBBLE; import static android.service.notification.NotificationListenerService.REASON_APP_CANCEL; import static android.service.notification.NotificationListenerService.REASON_GROUP_SUMMARY_CANCELED; import static com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; Loading Loading @@ -97,7 +100,6 @@ import com.android.wm.shell.bubbles.BubbleData; import com.android.wm.shell.bubbles.BubbleDataRepository; import com.android.wm.shell.bubbles.BubbleEntry; import com.android.wm.shell.bubbles.BubbleLogger; import com.android.wm.shell.bubbles.BubbleOverflow; import com.android.wm.shell.bubbles.BubbleStackView; import com.android.wm.shell.bubbles.Bubbles; import com.android.wm.shell.common.DisplayController; Loading Loading @@ -572,7 +574,7 @@ public class NewNotifPipelineBubblesTest extends SysuiTestCase { } @Test public void testRemoveLastExpanded_selectsOverflow() { public void testRemoveLastExpanded_collapses() { // Mark it as a bubble and add it explicitly mEntryListener.onEntryAdded(mRow); mEntryListener.onEntryAdded(mRow2); Loading Loading @@ -611,11 +613,10 @@ public class NewNotifPipelineBubblesTest extends SysuiTestCase { stackView.getExpandedBubble().getKey()).getKey(), Bubbles.DISMISS_USER_GESTURE); // Overflow should be selected assertEquals(mBubbleData.getSelectedBubble().getKey(), BubbleOverflow.KEY); verify(mBubbleExpandListener).onBubbleExpandChanged(true, BubbleOverflow.KEY); assertTrue(mBubbleController.hasBubbles()); assertSysuiStates(true /* stackExpanded */, false /* mangeMenuExpanded */); // We should be collapsed verify(mBubbleExpandListener).onBubbleExpandChanged(false, mRow.getKey()); assertFalse(mBubbleController.hasBubbles()); assertSysuiStates(false /* stackExpanded */, false /* mangeMenuExpanded */); } @Test Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleData.java +4 −11 Original line number Diff line number Diff line Loading @@ -562,18 +562,11 @@ public class BubbleData { overflowBubble(reason, bubbleToRemove); if (mBubbles.size() == 1) { 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. mStateChange.orderChanged = true; Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/BubbleDataTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -794,7 +794,7 @@ public class BubbleDataTest extends ShellTestCase { } @Test public void test_expanded_removeLastBubble_showsOverflowIfNotEmpty() { public void test_expanded_removeLastBubble_collapsesIfOverflowNotEmpty() { // Setup sendUpdatedEntryAtTime(mEntryA1, 1000); changeExpandedStateAtTime(true, 2000); Loading @@ -804,7 +804,7 @@ public class BubbleDataTest extends ShellTestCase { mBubbleData.dismissBubbleWithKey(mEntryA1.getKey(), Bubbles.DISMISS_USER_GESTURE); verifyUpdateReceived(); assertThat(mBubbleData.getOverflowBubbles().size()).isGreaterThan(0); assertSelectionChangedTo(mBubbleData.getOverflow()); assertExpandedChangedTo(false); } @Test Loading
packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java +5 −7 Original line number Diff line number Diff line Loading @@ -116,7 +116,6 @@ import com.android.wm.shell.bubbles.BubbleDataRepository; import com.android.wm.shell.bubbles.BubbleEntry; import com.android.wm.shell.bubbles.BubbleIconFactory; import com.android.wm.shell.bubbles.BubbleLogger; import com.android.wm.shell.bubbles.BubbleOverflow; import com.android.wm.shell.bubbles.BubbleStackView; import com.android.wm.shell.bubbles.BubbleViewInfoTask; import com.android.wm.shell.bubbles.Bubbles; Loading Loading @@ -631,7 +630,7 @@ public class BubblesTest extends SysuiTestCase { } @Test public void testRemoveLastExpanded_selectsOverflow() { public void testRemoveLastExpanded_collapses() { // Mark it as a bubble and add it explicitly mEntryListener.onPendingEntryAdded(mRow); mEntryListener.onPendingEntryAdded(mRow2); Loading Loading @@ -670,11 +669,10 @@ public class BubblesTest extends SysuiTestCase { stackView.getExpandedBubble().getKey()).getKey(), Bubbles.DISMISS_USER_GESTURE); // Overflow should be selected assertEquals(mBubbleData.getSelectedBubble().getKey(), BubbleOverflow.KEY); verify(mBubbleExpandListener).onBubbleExpandChanged(true, BubbleOverflow.KEY); assertTrue(mBubbleController.hasBubbles()); assertSysuiStates(true /* stackExpanded */, false /* mangeMenuExpanded */); // We should be collapsed verify(mBubbleExpandListener).onBubbleExpandChanged(false, mRow.getKey()); assertFalse(mBubbleController.hasBubbles()); assertSysuiStates(false /* stackExpanded */, false /* mangeMenuExpanded */); } @Test Loading
packages/SystemUI/tests/src/com/android/systemui/wmshell/NewNotifPipelineBubblesTest.java +8 −7 Original line number Diff line number Diff line Loading @@ -19,8 +19,11 @@ package com.android.systemui.wmshell; import static android.app.Notification.FLAG_BUBBLE; import static android.service.notification.NotificationListenerService.REASON_APP_CANCEL; import static android.service.notification.NotificationListenerService.REASON_GROUP_SUMMARY_CANCELED; import static com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; Loading Loading @@ -97,7 +100,6 @@ import com.android.wm.shell.bubbles.BubbleData; import com.android.wm.shell.bubbles.BubbleDataRepository; import com.android.wm.shell.bubbles.BubbleEntry; import com.android.wm.shell.bubbles.BubbleLogger; import com.android.wm.shell.bubbles.BubbleOverflow; import com.android.wm.shell.bubbles.BubbleStackView; import com.android.wm.shell.bubbles.Bubbles; import com.android.wm.shell.common.DisplayController; Loading Loading @@ -572,7 +574,7 @@ public class NewNotifPipelineBubblesTest extends SysuiTestCase { } @Test public void testRemoveLastExpanded_selectsOverflow() { public void testRemoveLastExpanded_collapses() { // Mark it as a bubble and add it explicitly mEntryListener.onEntryAdded(mRow); mEntryListener.onEntryAdded(mRow2); Loading Loading @@ -611,11 +613,10 @@ public class NewNotifPipelineBubblesTest extends SysuiTestCase { stackView.getExpandedBubble().getKey()).getKey(), Bubbles.DISMISS_USER_GESTURE); // Overflow should be selected assertEquals(mBubbleData.getSelectedBubble().getKey(), BubbleOverflow.KEY); verify(mBubbleExpandListener).onBubbleExpandChanged(true, BubbleOverflow.KEY); assertTrue(mBubbleController.hasBubbles()); assertSysuiStates(true /* stackExpanded */, false /* mangeMenuExpanded */); // We should be collapsed verify(mBubbleExpandListener).onBubbleExpandChanged(false, mRow.getKey()); assertFalse(mBubbleController.hasBubbles()); assertSysuiStates(false /* stackExpanded */, false /* mangeMenuExpanded */); } @Test Loading