Ensure that SysUI & listeners get the newly updated bubble state
This CL fixes two issues:
1) When bubbles are posted we should note that the notification has
interrupted
2) When the bubble flag state changes it gets propagated to any listeners
Fixes: 131187135
Test: atest NotificationManagerServiceTest
Change-Id: I003a36b9938a4d1f4a69efea463a39fd0df1abda
diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
index 48edf67..e8b054e 100644
--- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
+++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
@@ -40,6 +40,7 @@
import android.app.ActivityTaskManager;
import android.app.IActivityTaskManager;
import android.app.Notification;
+import android.app.NotificationManager;
import android.content.Context;
import android.content.pm.ParceledListSlice;
import android.content.res.Configuration;
@@ -381,6 +382,10 @@
* @param notif the notification associated with this bubble.
*/
void updateBubble(NotificationEntry notif) {
+ // If this is an interruptive notif, mark that it's interrupted
+ if (notif.importance >= NotificationManager.IMPORTANCE_HIGH) {
+ notif.setInterruption();
+ }
mBubbleData.notificationEntryUpdated(notif);
}