Drop the 'initial' of suppressInitialNotification API
Relax the 'initial' bit of this API, i.e. apps could update a bubble
to 'suppress notification' and if their app is foreground, we would
remove the notification (but not the bubble).
Bug: 123542531
Test: incoming....
Change-Id: I256112c7a560e26ebc00efb11435298922bec11c
diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
index a5aed87..df1443c 100644
--- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
+++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
@@ -394,11 +394,8 @@
return;
}
if (shouldAutoBubbleForFlags(mContext, entry) || shouldBubble(entry)) {
- // TODO: handle group summaries
- boolean suppressNotification = entry.getBubbleMetadata() != null
- && entry.getBubbleMetadata().getSuppressInitialNotification()
- && isForegroundApp(entry.notification.getPackageName());
- entry.setShowInShadeWhenBubble(!suppressNotification);
+ // TODO: handle group summaries?
+ updateShowInShadeForSuppressNotification(entry);
}
}
@@ -419,7 +416,7 @@
}
if (mNotificationInterruptionStateProvider.shouldBubbleUp(entry)
&& alertAgain(entry, entry.notification.getNotification())) {
- entry.setShowInShadeWhenBubble(true);
+ updateShowInShadeForSuppressNotification(entry);
entry.setBubbleDismissed(false); // updates come back as bubbles even if dismissed
updateBubble(entry, true /* updatePosition */);
mStackView.updateDotVisibility(entry.key);
@@ -545,6 +542,13 @@
&& isForegroundApp(entry.notification.getPackageName());
}
+ private void updateShowInShadeForSuppressNotification(NotificationEntry entry) {
+ boolean suppressNotification = entry.getBubbleMetadata() != null
+ && entry.getBubbleMetadata().getSuppressNotification()
+ && isForegroundApp(entry.notification.getPackageName());
+ entry.setShowInShadeWhenBubble(!suppressNotification);
+ }
+
/**
* Return true if the applications with the package name is running in foreground.
*