Loading packages/SystemUI/src/com/android/systemui/bubbles/BubbleData.java +12 −1 Original line number Diff line number Diff line Loading @@ -208,7 +208,7 @@ public class BubbleData { b -> { notificationEntryUpdated(bubble, /* suppressFlyout */ false, /* showInShade */ true); setSelectedBubbleInternal(bubble); setSelectedBubble(bubble); }, mContext, stack, factory); dispatchPendingChanges(); Loading Loading @@ -760,6 +760,17 @@ public class BubbleData { return null; } @VisibleForTesting(visibility = PRIVATE) Bubble getOverflowBubbleWithKey(String key) { for (int i = 0; i < mOverflowBubbles.size(); i++) { Bubble bubble = mOverflowBubbles.get(i); if (bubble.getKey().equals(key)) { return bubble; } } return null; } @VisibleForTesting(visibility = PRIVATE) void setTimeSource(TimeSource timeSource) { mTimeSource = timeSource; Loading packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleControllerTest.java +19 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,8 @@ import com.android.systemui.statusbar.policy.ZenModeController; import com.android.systemui.util.FloatingContentCoordinator; import com.android.systemui.util.InjectionInflationController; import com.google.common.collect.ImmutableList; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; Loading Loading @@ -317,6 +319,23 @@ public class BubbleControllerTest extends SysuiTestCase { assertFalse(mSysUiStateBubblesExpanded); } @Test public void testPromoteBubble_autoExpand() { mBubbleController.updateBubble(mRow2.getEntry()); mBubbleController.updateBubble(mRow.getEntry()); mBubbleController.removeBubble( mRow.getEntry(), BubbleController.DISMISS_USER_GESTURE); Bubble b = mBubbleData.getOverflowBubbleWithKey(mRow.getEntry().getKey()); assertThat(mBubbleData.getOverflowBubbles()).isEqualTo(ImmutableList.of(b)); Bubble b2 = mBubbleData.getBubbleWithKey(mRow2.getEntry().getKey()); assertThat(mBubbleData.getSelectedBubble()).isEqualTo(b2); mBubbleController.promoteBubbleFromOverflow(b); assertThat(mBubbleData.getSelectedBubble()).isEqualTo(b); } @Test public void testRemoveBubble_withDismissedNotif() { mEntryListener.onPendingEntryAdded(mRow.getEntry()); Loading Loading
packages/SystemUI/src/com/android/systemui/bubbles/BubbleData.java +12 −1 Original line number Diff line number Diff line Loading @@ -208,7 +208,7 @@ public class BubbleData { b -> { notificationEntryUpdated(bubble, /* suppressFlyout */ false, /* showInShade */ true); setSelectedBubbleInternal(bubble); setSelectedBubble(bubble); }, mContext, stack, factory); dispatchPendingChanges(); Loading Loading @@ -760,6 +760,17 @@ public class BubbleData { return null; } @VisibleForTesting(visibility = PRIVATE) Bubble getOverflowBubbleWithKey(String key) { for (int i = 0; i < mOverflowBubbles.size(); i++) { Bubble bubble = mOverflowBubbles.get(i); if (bubble.getKey().equals(key)) { return bubble; } } return null; } @VisibleForTesting(visibility = PRIVATE) void setTimeSource(TimeSource timeSource) { mTimeSource = timeSource; Loading
packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleControllerTest.java +19 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,8 @@ import com.android.systemui.statusbar.policy.ZenModeController; import com.android.systemui.util.FloatingContentCoordinator; import com.android.systemui.util.InjectionInflationController; import com.google.common.collect.ImmutableList; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; Loading Loading @@ -317,6 +319,23 @@ public class BubbleControllerTest extends SysuiTestCase { assertFalse(mSysUiStateBubblesExpanded); } @Test public void testPromoteBubble_autoExpand() { mBubbleController.updateBubble(mRow2.getEntry()); mBubbleController.updateBubble(mRow.getEntry()); mBubbleController.removeBubble( mRow.getEntry(), BubbleController.DISMISS_USER_GESTURE); Bubble b = mBubbleData.getOverflowBubbleWithKey(mRow.getEntry().getKey()); assertThat(mBubbleData.getOverflowBubbles()).isEqualTo(ImmutableList.of(b)); Bubble b2 = mBubbleData.getBubbleWithKey(mRow2.getEntry().getKey()); assertThat(mBubbleData.getSelectedBubble()).isEqualTo(b2); mBubbleController.promoteBubbleFromOverflow(b); assertThat(mBubbleData.getSelectedBubble()).isEqualTo(b); } @Test public void testRemoveBubble_withDismissedNotif() { mEntryListener.onPendingEntryAdded(mRow.getEntry()); Loading