Loading packages/SystemUI/src/com/android/systemui/wmshell/BubblesManager.java +3 −1 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); } } Loading packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java +13 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -1125,6 +1126,18 @@ public class BubblesTest extends SysuiTestCase { assertFalse(mBubbleController.hasBubbles()); } @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); Loading Loading
packages/SystemUI/src/com/android/systemui/wmshell/BubblesManager.java +3 −1 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); } } Loading
packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java +13 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -1125,6 +1126,18 @@ public class BubblesTest extends SysuiTestCase { assertFalse(mBubbleController.hasBubbles()); } @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); Loading