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

Commit e4348272 authored by Mady Mellor's avatar Mady Mellor
Browse files

Fix a couple of mistakes with dots & summaries

* When dismissing a single bubble the notification got removed when
  it shouldn't be (because single bubble also considered summary)
* The dot being shown should be based on showBubbleDot, not showInShade
* Remove debug statement I never intended to check in! The entry shouldn't
  be null so it should be fine to assume non-null... if it is null we should
  break because something weird would be going on

Test: manual - dismiss a bubble, notice notification stays in shade
Bug: 138659213
Change-Id: I30c3666ff14c7d7ec5b6b461e5f50bc7460328e6
parent 8d82eb6c
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -455,7 +455,8 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
        NotificationEntry entry = mNotificationEntryManager.getNotificationData().get(key);
        String groupKey = entry != null ? entry.notification.getGroupKey() : null;
        boolean isSuppressedSummary = mBubbleData.isSummarySuppressed(groupKey);
        return isSuppressedSummary || isBubbleAndSuppressed;
        boolean isSummary = key.equals(mBubbleData.getSummaryKey(groupKey));
        return (isSummary && isSuppressedSummary) || isBubbleAndSuppressed;
    }

    void selectBubble(Bubble bubble) {
@@ -731,10 +732,6 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
                        mBubbleData.removeSuppressedSummary(groupKey);
                        NotificationEntry entry =
                                mNotificationEntryManager.getNotificationData().get(notifKey);
                        if (entry == null) {
                            Log.w("mady", "WTF summary isn't in data... " + notifKey);
                            return;
                        }
                        mNotificationEntryManager.performRemoveNotification(
                                entry.notification, UNDEFINED_DISMISS_REASON);
                    }
@@ -745,7 +742,9 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
                    if (summary != null) {
                        ArrayList<NotificationEntry> summaryChildren =
                                mNotificationGroupManager.getLogicalChildren(summary.notification);
                        if (summaryChildren == null || summaryChildren.isEmpty()) {
                        boolean isSummaryThisNotif = summary.key.equals(bubble.getEntry().key);
                        if (!isSummaryThisNotif
                                && (summaryChildren == null || summaryChildren.isEmpty())) {
                            mNotificationEntryManager.performRemoveNotification(
                                    summary.notification, UNDEFINED_DISMISS_REASON);
                        }
+1 −1
Original line number Diff line number Diff line
@@ -255,7 +255,7 @@ public class BubbleView extends FrameLayout {
        iconPath.transform(matrix);
        mBadgedImageView.drawDot(iconPath);

        animateDot(mBubble.showInShadeWhenBubble() /* showDot */, null /* after */);
        animateDot(mBubble.showBubbleDot() /* showDot */, null /* after */);
    }

    int getBadgeColor() {