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

Commit 26d91270 authored by Gus Prevas's avatar Gus Prevas
Browse files

Removes dependency of NotificationEntryManager on NotificationGroupManager.

This change removes the aforementioned dependency by having
NotificationData inform the group manager of notification updates; this
parallels the approach taken for adding and removing notifications.

Test: atest SystemUITests, manual
Change-Id: I3811cc70309e1a4dc513a58385e52d991c31f620
parent 772e5325
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -827,6 +827,14 @@ public class NotificationData {
        return removed;
    }

    /** Updates the given notification entry with the provided ranking. */
    public void update(Entry entry, RankingMap ranking, StatusBarNotification notification) {
        updateRanking(ranking);
        final StatusBarNotification oldNotification = entry.notification;
        entry.notification = notification;
        mGroupManager.onEntryUpdated(entry, oldNotification);
    }

    public void updateRanking(RankingMap ranking) {
        updateRankingAndSort(ranking);
    }
+1 −8
Original line number Diff line number Diff line
@@ -51,7 +51,6 @@ import com.android.systemui.statusbar.notification.row.NotificationGutsManager;
import com.android.systemui.statusbar.notification.row.NotificationInflater;
import com.android.systemui.statusbar.notification.row.NotificationInflater.InflationFlag;
import com.android.systemui.statusbar.notification.stack.NotificationListContainer;
import com.android.systemui.statusbar.phone.NotificationGroupManager;
import com.android.systemui.statusbar.policy.DeviceProvisionedController;
import com.android.systemui.statusbar.policy.HeadsUpManager;
import com.android.systemui.util.leak.LeakDetector;
@@ -82,8 +81,6 @@ public class NotificationEntryManager implements
    protected final Context mContext;
    protected final HashMap<String, NotificationData.Entry> mPendingNotifications = new HashMap<>();

    private final NotificationGroupManager mGroupManager =
            Dependency.get(NotificationGroupManager.class);
    private final NotificationGutsManager mGutsManager =
            Dependency.get(NotificationGutsManager.class);
    private final DeviceProvisionedController mDeviceProvisionedController =
@@ -556,11 +553,7 @@ public class NotificationEntryManager implements
            extender.setShouldManageLifetime(entry, false /* shouldManage */);
        }

        mNotificationData.updateRanking(ranking);

        final StatusBarNotification oldNotification = entry.notification;
        entry.notification = notification;
        mGroupManager.onEntryUpdated(entry, oldNotification);
        mNotificationData.update(entry, ranking, notification);

        entry.updateIcons(mContext, notification);
        getRowBinder().inflateViews(entry, () -> performRemoveNotification(notification),