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

Commit ed8aea27 authored by Beverly's avatar Beverly
Browse files

Refactor parts of BubbleController

So it'll be easier to switch out NEM for the new notification pipeline

Test: atest SystemUITests
Change-Id: I97b1949695fde1e67f6a8782ab21bb726a5bdde1
parent 6af94e41
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