Don't require resizable check for experimental bubbles
Test: manual - 1) adb shell settings put secure allow_any_notif_to_bubble 1
2) get an notification for an activity that isn't resizable
3) longpress on the notif, note the bubble menu is there
4) select bubble
=> the notification becomes a bubble
Bug: 143173197
Change-Id: Ie0b91971a969203000d9cfa19b50e44fd4c9c490
diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
index ed21e14..15bb330 100644
--- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
+++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
@@ -700,10 +700,11 @@
@Override
public void onPendingEntryAdded(NotificationEntry entry) {
boolean previouslyUserCreated = mUserCreatedBubbles.contains(entry.getKey());
- BubbleExperimentConfig.adjustForExperiments(mContext, entry, previouslyUserCreated);
+ boolean wasAdjusted = BubbleExperimentConfig.adjustForExperiments(
+ mContext, entry, previouslyUserCreated);
if (mNotificationInterruptionStateProvider.shouldBubbleUp(entry)
- && canLaunchInActivityView(mContext, entry)) {
+ && (canLaunchInActivityView(mContext, entry) || wasAdjusted)) {
updateBubble(entry);
}
}
@@ -711,10 +712,11 @@
@Override
public void onPreEntryUpdated(NotificationEntry entry) {
boolean previouslyUserCreated = mUserCreatedBubbles.contains(entry.getKey());
- BubbleExperimentConfig.adjustForExperiments(mContext, entry, previouslyUserCreated);
+ boolean wasAdjusted = BubbleExperimentConfig.adjustForExperiments(
+ mContext, entry, previouslyUserCreated);
boolean shouldBubble = mNotificationInterruptionStateProvider.shouldBubbleUp(entry)
- && canLaunchInActivityView(mContext, entry);
+ && (canLaunchInActivityView(mContext, entry) || wasAdjusted);
if (!shouldBubble && mBubbleData.hasBubbleWithKey(entry.getKey())) {
// It was previously a bubble but no longer a bubble -- lets remove it
removeBubble(entry.getKey(), DISMISS_NO_LONGER_BUBBLE);
@@ -1022,11 +1024,6 @@
PendingIntent intent = entry.getBubbleMetadata() != null
? entry.getBubbleMetadata().getIntent()
: null;
- return canLaunchIntentInActivityView(context, entry, intent);
- }
-
- static boolean canLaunchIntentInActivityView(Context context, NotificationEntry entry,
- PendingIntent intent) {
if (intent == null) {
Log.w(TAG, "Unable to create bubble -- no intent: " + entry.getKey());
return false;