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

Commit 224cd351 authored by Mady Mellor's avatar Mady Mellor Committed by android-build-merger
Browse files

Merge "Notify display is empty even if it's not the expanded bubble" into...

Merge "Notify display is empty even if it's not the expanded bubble" into qt-qpr1-dev am: 4cb4e0a1
am: 2facafe8

Change-Id: I672133b7a323a8122174d642862393390ae79457
parents 9b1731f2 2facafe8
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -558,7 +558,7 @@ public class BubbleController implements ConfigurationController.ConfigurationLi

                // Need to check for !appCancel here because the notification may have
                // previously been dismissed & entry.isRowDismissed would still be true
                boolean userRemovedNotif = (entry.isRowDismissed() && !isAppCancel)
                boolean userRemovedNotif = (entry != null && entry.isRowDismissed() && !isAppCancel)
                        || isClearAll || isUserDimiss || isSummaryCancel;

                if (isSummaryOfBubbles) {
@@ -568,7 +568,7 @@ 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.isBubble() && userRemovedNotif;
                boolean bubbleExtended = entry != null && entry.isBubble() && userRemovedNotif;
                if (bubbleExtended) {
                    bubble.setShowInShadeWhenBubble(false);
                    bubble.setShowBubbleDot(false);
@@ -577,7 +577,7 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
                    }
                    mNotificationEntryManager.updateNotifications();
                    return true;
                } else if (!userRemovedNotif) {
                } 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;
@@ -937,13 +937,11 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
            final Bubble expandedBubble = mStackView != null
                    ? mStackView.getExpandedBubble()
                    : null;
            if (expandedBubble == null) {
                return;
            }
            if (expandedBubble.getDisplayId() == displayId) {
            int expandedId = expandedBubble != null ? expandedBubble.getDisplayId() : -1;
            if (mStackView != null && mStackView.isExpanded() && expandedId == displayId) {
                mBubbleData.setExpanded(false);
                expandedBubble.getExpandedView().notifyDisplayEmpty();
            }
            mBubbleData.notifyDisplayEmpty(displayId);
        }
    }

+16 −0
Original line number Diff line number Diff line
@@ -396,6 +396,22 @@ public class BubbleData {
        dispatchPendingChanges();
    }

    /**
     * Indicates that the provided display is no longer in use and should be cleaned up.
     *
     * @param displayId the id of the display to clean up.
     */
    void notifyDisplayEmpty(int displayId) {
        for (Bubble b : mBubbles) {
            if (b.getDisplayId() == displayId) {
                if (b.getExpandedView() != null) {
                    b.getExpandedView().notifyDisplayEmpty();
                }
                return;
            }
        }
    }

    private void dispatchPendingChanges() {
        if (mListener != null && mStateChange.anythingChanged()) {
            mListener.applyUpdate(mStateChange);