diff options
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/wmshell/BubblesManager.java | 4 | ||||
| -rw-r--r-- | packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java | 13 |
2 files changed, 16 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/wmshell/BubblesManager.java b/packages/SystemUI/src/com/android/systemui/wmshell/BubblesManager.java index e76401528ff6..b23efcea1c2c 100644 --- a/packages/SystemUI/src/com/android/systemui/wmshell/BubblesManager.java +++ b/packages/SystemUI/src/com/android/systemui/wmshell/BubblesManager.java @@ -23,6 +23,7 @@ import static android.service.notification.NotificationListenerService.REASON_AP import static android.service.notification.NotificationListenerService.REASON_APP_CANCEL_ALL; import static android.service.notification.NotificationListenerService.REASON_GROUP_SUMMARY_CANCELED; import static android.service.notification.NotificationListenerService.REASON_PACKAGE_BANNED; +import static android.service.notification.NotificationListenerService.REASON_PACKAGE_CHANGED; import static android.service.notification.NotificationStats.DISMISSAL_BUBBLE; import static android.service.notification.NotificationStats.DISMISS_SENTIMENT_NEUTRAL; @@ -451,7 +452,8 @@ public class BubblesManager { public void onEntryRemoved(NotificationEntry entry, @NotifCollection.CancellationReason int reason) { if (reason == REASON_APP_CANCEL || reason == REASON_APP_CANCEL_ALL - || reason == REASON_PACKAGE_BANNED) { + || reason == REASON_PACKAGE_BANNED + || reason == REASON_PACKAGE_CHANGED) { BubblesManager.this.onEntryRemoved(entry); } } diff --git a/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java b/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java index a38d71b178e9..68d84ecaf4b1 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java @@ -25,6 +25,7 @@ import static android.service.notification.NotificationListenerService.NOTIFICAT import static android.service.notification.NotificationListenerService.REASON_APP_CANCEL; import static android.service.notification.NotificationListenerService.REASON_GROUP_SUMMARY_CANCELED; import static android.service.notification.NotificationListenerService.REASON_PACKAGE_BANNED; +import static android.service.notification.NotificationListenerService.REASON_PACKAGE_CHANGED; import static com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn; import static com.android.server.notification.Flags.FLAG_SCREENSHARE_NOTIFICATION_HIDING; @@ -1126,6 +1127,18 @@ public class BubblesTest extends SysuiTestCase { } @Test + public void testNotifsPackageChanged_entryListenerRemove() { + mEntryListener.onEntryAdded(mRow); + mBubbleController.updateBubble(mBubbleEntry); + + assertTrue(mBubbleController.hasBubbles()); + + // Removes the notification + mEntryListener.onEntryRemoved(mRow, REASON_PACKAGE_CHANGED); + assertFalse(mBubbleController.hasBubbles()); + } + + @Test public void removeBubble_intercepted() { mEntryListener.onEntryAdded(mRow); mBubbleController.updateBubble(mBubbleEntry); |