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

Commit 8ca8957e authored by Mady Mellor's avatar Mady Mellor
Browse files

When convo is set as important, only bubble if it can

Previously we called this code regardless of the entry
having bubble metadata or not, this is incorrect & had
the side effect of collapsing the shade when it shouldn't.

Test: manual - mark conversation without bubble metadata
      as important, note the shade doesn't collapse.
Fixes: 177566866
Change-Id: I5eee9ac7bc9b3d2e4abb7ea171d6263007fe68a6
parent db3a0b49
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -642,9 +642,8 @@ public class NotificationConversationInfo extends LinearLayout implements
                                        BUBBLE_PREFERENCE_SELECTED);
                                        BUBBLE_PREFERENCE_SELECTED);
                            }
                            }
                            if (mBubblesManagerOptional.isPresent()) {
                            if (mBubblesManagerOptional.isPresent()) {
                                post(() -> {
                                post(() -> mBubblesManagerOptional.get()
                                    mBubblesManagerOptional.get().onUserChangedImportance(mEntry);
                                        .onUserSetImportantConversation(mEntry));
                                });
                            }
                            }
                        }
                        }
                        mChannelToUpdate.setImportance(Math.max(
                        mChannelToUpdate.setImportance(Math.max(
+8 −4
Original line number Original line Diff line number Diff line
@@ -615,12 +615,16 @@ public class BubblesManager implements Dumpable {
    }
    }


    /**
    /**
     * When a notification is marked Priority, expand the stack if needed,
     * When a notification is set as important, make it a bubble and expand the stack if
     * then (maybe create and) select the given bubble.
     * it can bubble.
     *
     *
     * @param entry the notification for the bubble to show
     * @param entry the important notification.
     */
     */
    public void onUserChangedImportance(NotificationEntry entry) {
    public void onUserSetImportantConversation(NotificationEntry entry) {
        if (entry.getBubbleMetadata() == null) {
            // No bubble metadata, nothing to do.
            return;
        }
        try {
        try {
            int flags = Notification.BubbleMetadata.FLAG_SUPPRESS_NOTIFICATION;
            int flags = Notification.BubbleMetadata.FLAG_SUPPRESS_NOTIFICATION;
            flags |= Notification.BubbleMetadata.FLAG_AUTO_EXPAND_BUBBLE;
            flags |= Notification.BubbleMetadata.FLAG_AUTO_EXPAND_BUBBLE;