Allow a list of packages to be whitelisted to auto-bubble
If the notification has metadata (regardless if from experiment or not)
and that package has been whitelisted, then it will automatically bubble.
Supports multiple packages as long as it's in a comma separated list.
Test: manual:
1) set some packages to be whitelisted:
adb shell settings put secure whitelisted_auto_bubble_apps com.instagram.android,com.google.android.calendar,com.google.android.apps.photos
2) enable message bubbles / any bubbles:
adb shell settings put secure allow_any_notifs_to_bubble 1
3) get a notification that has enough info to bubble from one of those apps
=> it autobubbles
4) get an update to that notification
=> it goes to the bubble
Bug: 145763712
Change-Id: Ic2c26968dcb345e088044a73b30fef82d65552ae
diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
index 15bb330..4b564f4 100644
--- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
+++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
@@ -705,6 +705,10 @@
if (mNotificationInterruptionStateProvider.shouldBubbleUp(entry)
&& (canLaunchInActivityView(mContext, entry) || wasAdjusted)) {
+ if (wasAdjusted && !previouslyUserCreated) {
+ // Gotta treat the auto-bubbled / whitelisted packaged bubbles as usercreated
+ mUserCreatedBubbles.add(entry.getKey());
+ }
updateBubble(entry);
}
}
@@ -721,6 +725,10 @@
// It was previously a bubble but no longer a bubble -- lets remove it
removeBubble(entry.getKey(), DISMISS_NO_LONGER_BUBBLE);
} else if (shouldBubble) {
+ if (wasAdjusted && !previouslyUserCreated) {
+ // Gotta treat the auto-bubbled / whitelisted packaged bubbles as usercreated
+ mUserCreatedBubbles.add(entry.getKey());
+ }
updateBubble(entry);
}
}