Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 91b31e67 authored by Mady Mellor's avatar Mady Mellor
Browse files

If an app cancels an experimental bubble, update the dot to hide

We don't honour app cancels for experimental bubbles, but we should
hide the dot on the bubble when the app cancels a notification for
an experimental bubble. Typically if an app cancels a notification
it means that content is "read" (at least for bubbles) so the dot
shouldn't be necessary.

Test: - get an experimental bubble from some conversation
      - navigate to that conversation in the app, not the bubble
      => Note that the notification is gone from the shade and the
         bubble no longer has a dot
Fixes: 147232318

Change-Id: If2a89896c7ee0c2264385c6fb501569abdc02b22
parent 8ac84650
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -971,7 +971,7 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
     * The cancellation of summaries with children associated with bubbles are also handled in this
     * method. User-cancelled summaries are tracked by {@link BubbleData#addSummaryToSuppress}.
     *
     * @return true if we want to intercept the dismissal of the entry, else false
     * @return true if we want to intercept the dismissal of the entry, else false.
     */
    public boolean shouldInterceptDismissal(NotificationEntry entry, int dismissReason) {
        if (entry == null) {
@@ -1011,7 +1011,8 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
        // The bubble notification sticks around in the data as long as the bubble is
        // not dismissed and the app hasn't cancelled the notification.
        Bubble bubble = mBubbleData.getBubbleWithKey(key);
        boolean bubbleExtended = entry != null && entry.isBubble() && userRemovedNotif;
        boolean bubbleExtended = entry != null && entry.isBubble()
                && (userRemovedNotif || isUserCreatedBubble(bubble.getKey()));
        if (bubbleExtended) {
            bubble.setSuppressNotification(true);
            bubble.setShowDot(false /* show */, true /* animate */);
@@ -1020,8 +1021,7 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
                        + ".shouldInterceptDismissal");
            }
            return true;
        } else if (!userRemovedNotif && entry != null
                && !isUserCreatedBubble(bubble.getKey())) {
        } else if (!userRemovedNotif && entry != null) {
            // This wasn't a user removal so we should remove the bubble as well
            mBubbleData.notificationEntryRemoved(entry, DISMISS_NOTIF_CANCEL);
            return false;