BubbleData [1/n]: remove unused parameter
Remove an unused parameter from updateBubble (always true).
Eventually BubbleData will determine and apply and changes in
position, affecting other bubbles potentially.
Bug: 123542488
Test: atest BubbleControllerTest
Change-Id: Id90d9c905f63f90273205de91f0cff3e221c1ba4
diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
index 56b231b..33fe04c 100644
--- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
+++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
@@ -325,12 +325,11 @@
* Adds or updates a bubble associated with the provided notification entry.
*
* @param notif the notification associated with this bubble.
- * @param updatePosition whether this update should promote the bubble to the top of the stack.
*/
- public void updateBubble(NotificationEntry notif, boolean updatePosition) {
+ void updateBubble(NotificationEntry notif) {
if (mStackView != null && mBubbleData.getBubble(notif.key) != null) {
// It's an update
- mStackView.updateBubble(notif, updatePosition);
+ mStackView.updateBubble(notif);
} else {
if (mStackView == null) {
mStackView = new BubbleStackView(mContext, mBubbleData, mSurfaceSynchronizer);
@@ -403,7 +402,7 @@
return;
}
if (entry.isBubble() && mNotificationInterruptionStateProvider.shouldBubbleUp(entry)) {
- updateBubble(entry, true /* updatePosition */);
+ updateBubble(entry);
}
}
@@ -416,7 +415,7 @@
&& alertAgain(entry, entry.notification.getNotification())) {
entry.setShowInShadeWhenBubble(true);
entry.setBubbleDismissed(false); // updates come back as bubbles even if dismissed
- updateBubble(entry, true /* updatePosition */);
+ updateBubble(entry);
mStackView.updateDotVisibility(entry.key);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java
index 00b1c9e..3d8dc07 100644
--- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java
+++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java
@@ -595,15 +595,13 @@
/**
* Updates a bubble in the stack.
- *
- * @param entry the entry to update in the stack.
- * @param updatePosition whether this bubble should be moved to top of the stack.
+ * @param entry the entry to update in the stack.
*/
- public void updateBubble(NotificationEntry entry, boolean updatePosition) {
+ public void updateBubble(NotificationEntry entry) {
Bubble b = mBubbleData.getBubble(entry.key);
mBubbleData.updateBubble(entry.key, entry);
- if (updatePosition && !mIsExpanded) {
+ if (!mIsExpanded) {
// If alerting it gets promoted to top of the stack.
if (mBubbleContainer.indexOfChild(b.iconView) != 0) {
mBubbleContainer.moveViewTo(b.iconView, 0);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleControllerTest.java
index 5e16721..20f539b 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleControllerTest.java
@@ -160,7 +160,7 @@
@Test
public void testAddBubble() {
- mBubbleController.updateBubble(mRow.getEntry(), true /* updatePosition */);
+ mBubbleController.updateBubble(mRow.getEntry());
assertTrue(mBubbleController.hasBubbles());
verify(mBubbleStateChangeListener).onHasBubblesChanged(true);
@@ -169,13 +169,13 @@
@Test
public void testHasBubbles() {
assertFalse(mBubbleController.hasBubbles());
- mBubbleController.updateBubble(mRow.getEntry(), true /* updatePosition */);
+ mBubbleController.updateBubble(mRow.getEntry());
assertTrue(mBubbleController.hasBubbles());
}
@Test
public void testRemoveBubble() {
- mBubbleController.updateBubble(mRow.getEntry(), true /* updatePosition */);
+ mBubbleController.updateBubble(mRow.getEntry());
assertTrue(mBubbleController.hasBubbles());
verify(mBubbleStateChangeListener).onHasBubblesChanged(true);
@@ -189,8 +189,8 @@
@Test
public void testDismissStack() {
- mBubbleController.updateBubble(mRow.getEntry(), true /* updatePosition */);
- mBubbleController.updateBubble(mRow2.getEntry(), true /* updatePosition */);
+ mBubbleController.updateBubble(mRow.getEntry());
+ mBubbleController.updateBubble(mRow2.getEntry());
assertTrue(mBubbleController.hasBubbles());
mBubbleController.dismissStack(BubbleController.DISMISS_USER_GESTURE);
@@ -206,7 +206,7 @@
// Mark it as a bubble and add it explicitly
mEntryListener.onPendingEntryAdded(mRow.getEntry());
- mBubbleController.updateBubble(mRow.getEntry(), true /* updatePosition */);
+ mBubbleController.updateBubble(mRow.getEntry());
// We should have bubbles & their notifs should show in the shade
assertTrue(mBubbleController.hasBubbles());
@@ -235,8 +235,8 @@
// Mark it as a bubble and add it explicitly
mEntryListener.onPendingEntryAdded(mRow.getEntry());
mEntryListener.onPendingEntryAdded(mRow2.getEntry());
- mBubbleController.updateBubble(mRow.getEntry(), true /* updatePosition */);
- mBubbleController.updateBubble(mRow2.getEntry(), true /* updatePosition */);
+ mBubbleController.updateBubble(mRow.getEntry());
+ mBubbleController.updateBubble(mRow2.getEntry());
// We should have bubbles & their notifs should show in the shade
assertTrue(mBubbleController.hasBubbles());
@@ -272,7 +272,7 @@
public void testExpansionRemovesShowInShade() {
// Mark it as a bubble and add it explicitly
mEntryListener.onPendingEntryAdded(mRow.getEntry());
- mBubbleController.updateBubble(mRow.getEntry(), true /* updatePosition */);
+ mBubbleController.updateBubble(mRow.getEntry());
// We should have bubbles & their notifs should show in the shade
assertTrue(mBubbleController.hasBubbles());
@@ -293,8 +293,8 @@
// Mark it as a bubble and add it explicitly
mEntryListener.onPendingEntryAdded(mRow.getEntry());
mEntryListener.onPendingEntryAdded(mRow2.getEntry());
- mBubbleController.updateBubble(mRow.getEntry(), true /* updatePosition */);
- mBubbleController.updateBubble(mRow2.getEntry(), true /* updatePosition */);
+ mBubbleController.updateBubble(mRow.getEntry());
+ mBubbleController.updateBubble(mRow2.getEntry());
verify(mBubbleStateChangeListener).onHasBubblesChanged(true);
// Expand
@@ -333,7 +333,7 @@
// Add the auto expand bubble
mEntryListener.onPendingEntryAdded(mAutoExpandRow.getEntry());
- mBubbleController.updateBubble(mAutoExpandRow.getEntry(), true /* updatePosition */);
+ mBubbleController.updateBubble(mAutoExpandRow.getEntry());
// Expansion shouldn't change
verify(mBubbleExpandListener, never()).onBubbleExpandChanged(false /* expanded */,
@@ -371,7 +371,7 @@
// Add the auto expand bubble
mEntryListener.onPendingEntryAdded(mAutoExpandRow.getEntry());
- mBubbleController.updateBubble(mAutoExpandRow.getEntry(), true /* updatePosition */);
+ mBubbleController.updateBubble(mAutoExpandRow.getEntry());
// Expansion should change
verify(mBubbleExpandListener).onBubbleExpandChanged(true /* expanded */,
@@ -387,7 +387,7 @@
public void testSuppressNotif_FailsNotForeground() {
// Add the suppress notif bubble
mEntryListener.onPendingEntryAdded(mSuppressNotifRow.getEntry());
- mBubbleController.updateBubble(mSuppressNotifRow.getEntry(), true /* updatePosition */);
+ mBubbleController.updateBubble(mSuppressNotifRow.getEntry());
// Should show in shade because we weren't forground
assertTrue(mSuppressNotifRow.getEntry().showInShadeWhenBubble());
@@ -423,7 +423,7 @@
// Add the suppress notif bubble
mEntryListener.onPendingEntryAdded(mSuppressNotifRow.getEntry());
- mBubbleController.updateBubble(mSuppressNotifRow.getEntry(), true /* updatePosition */);
+ mBubbleController.updateBubble(mSuppressNotifRow.getEntry());
// Should NOT show in shade because we were foreground
assertFalse(mSuppressNotifRow.getEntry().showInShadeWhenBubble());
@@ -438,7 +438,7 @@
final String key = mRow.getEntry().key;
mEntryListener.onPendingEntryAdded(mRow.getEntry());
- mBubbleController.updateBubble(mRow.getEntry(), true /* updatePosition */);
+ mBubbleController.updateBubble(mRow.getEntry());
// Simulate notification cancellation.
mEntryListener.onEntryRemoved(mRow.getEntry(), null /* notificationVisibility (unused) */,
@@ -464,22 +464,22 @@
@Test
public void testDeleteIntent_removeBubble_aged() throws PendingIntent.CanceledException {
- mBubbleController.updateBubble(mRow.getEntry(), true /* updatePosition */);
+ mBubbleController.updateBubble(mRow.getEntry());
mBubbleController.removeBubble(mRow.getEntry().key, BubbleController.DISMISS_AGED);
verify(mDeleteIntent, never()).send();
}
@Test
public void testDeleteIntent_removeBubble_user() throws PendingIntent.CanceledException {
- mBubbleController.updateBubble(mRow.getEntry(), true /* updatePosition */);
+ mBubbleController.updateBubble(mRow.getEntry());
mBubbleController.removeBubble(mRow.getEntry().key, BubbleController.DISMISS_USER_GESTURE);
verify(mDeleteIntent, times(1)).send();
}
@Test
public void testDeleteIntent_dismissStack() throws PendingIntent.CanceledException {
- mBubbleController.updateBubble(mRow.getEntry(), true /* updatePosition */);
- mBubbleController.updateBubble(mRow2.getEntry(), true /* updatePosition */);
+ mBubbleController.updateBubble(mRow.getEntry());
+ mBubbleController.updateBubble(mRow2.getEntry());
mBubbleController.dismissStack(BubbleController.DISMISS_USER_GESTURE);
verify(mDeleteIntent, times(2)).send();
}