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

Commit 5f76f8bc authored by Beverly Tai's avatar Beverly Tai Committed by Android (Google) Code Review
Browse files

Merge "Refactor parts of BubbleController"

parents 2116f0e5 ed8aea27
Loading
Loading
Loading
Loading
+301 −199

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
@@ -140,7 +140,7 @@ public class NotificationViewHierarchyManager implements DynamicPrivacyControlle
            boolean hideMedia = Utils.useQsMediaPlayer(mContext);
            if (ent.isRowDismissed() || ent.isRowRemoved()
                    || (ent.isMediaNotification() && hideMedia)
                    || mBubbleController.isBubbleNotificationSuppressedFromShade(ent.getKey())) {
                    || mBubbleController.isBubbleNotificationSuppressedFromShade(ent)) {
                // we don't want to update removed notifications because they could
                // temporarily become children if they were isolated before.
                continue;
+9 −0
Original line number Diff line number Diff line
@@ -214,6 +214,7 @@ public class NotifCollection implements Dumpable {
    private void onNotificationRankingUpdate(RankingMap rankingMap) {
        Assert.isMainThread();
        applyRanking(rankingMap);
        dispatchNotificationRankingUpdate(rankingMap);
        rebuildList();
    }

@@ -393,6 +394,14 @@ public class NotifCollection implements Dumpable {
        mAmDispatchingToOtherCode = false;
    }

    private void dispatchNotificationRankingUpdate(RankingMap map) {
        mAmDispatchingToOtherCode = true;
        for (NotifCollectionListener listener : mNotifCollectionListeners) {
            listener.onRankingUpdate(map);
        }
        mAmDispatchingToOtherCode = false;
    }

    private void dispatchOnEntryRemoved(
            NotificationEntry entry,
            @CancellationReason int reason,
+9 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.systemui.statusbar.notification.collection.notifcollection;

import android.service.notification.NotificationListenerService;

import com.android.systemui.statusbar.notification.collection.NotifCollection;
import com.android.systemui.statusbar.notification.collection.NotifCollection.CancellationReason;
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
@@ -47,4 +49,11 @@ public interface NotifCollectionListener {
            @CancellationReason int reason,
            boolean removedByUser) {
    }

    /**
     * Called whenever the RankingMap is updated by system server. By the time this listener is
     * called, the Rankings of all entries will have been updated.
     */
    default void onRankingUpdate(NotificationListenerService.RankingMap rankingMap) {
    }
}
+2 −2
Original line number Diff line number Diff line
@@ -204,8 +204,8 @@ public class NotificationGroupManager implements OnHeadsUpChangedListener, State
        }
        int childCount = 0;
        boolean hasBubbles = false;
        for (String key : group.children.keySet()) {
            if (!getBubbleController().isBubbleNotificationSuppressedFromShade(key)) {
        for (NotificationEntry entry : group.children.values()) {
            if (!getBubbleController().isBubbleNotificationSuppressedFromShade(entry)) {
                childCount++;
            } else {
                hasBubbles = true;
Loading