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

Commit fd868797 authored by Jeff DeCew's avatar Jeff DeCew
Browse files

Refactor legacy pipeline group alert transfer & group manager

This fixes cases where changes to Group.suppressed or Group.alertOverride were not correctly emitted when the parent was updated before the priority child.

Bug: 185680162
Test: manual testing w/ telegram and whatsapp
Test: atest NotificationGroupAlertTransferHelperTest
Test: atest NotificationGroupManagerLegacyTest
Change-Id: I0ee8e9cf6c17a287f7ecbba6318e154ee8889174
parent 1439429d
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.widget.ImageView;

import com.android.internal.util.ContrastColorUtil;
import com.android.systemui.R;
import com.android.systemui.statusbar.notification.collection.NotificationEntry;

/**
 * A util class for various reusable functions
@@ -73,4 +74,20 @@ public class NotificationUtils {
        return (int) (dimensionPixelSize * factor);
    }

    /** Get the notification key, reformatted for logging, for the (optional) entry */
    public static String logKey(NotificationEntry entry) {
        if (entry == null) {
            return "null";
        }
        return logKey(entry.getKey());
    }

    /** Removes newlines from the notification key to prettify apps that have these in the tag */
    public static String logKey(String key) {
        if (key == null) {
            return "null";
        }
        return key.replace("\n", "");
    }

}
+181 −78

File changed.

Preview size limit exceeded, changes collapsed.

+0 −6
Original line number Diff line number Diff line
@@ -93,7 +93,6 @@ import com.android.systemui.statusbar.notification.collection.NotifCollection;
import com.android.systemui.statusbar.notification.collection.NotifPipeline;
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
import com.android.systemui.statusbar.notification.collection.legacy.NotificationGroupManagerLegacy;
import com.android.systemui.statusbar.notification.collection.legacy.NotificationGroupManagerLegacy.NotificationGroup;
import com.android.systemui.statusbar.notification.collection.legacy.NotificationGroupManagerLegacy.OnGroupChangeListener;
import com.android.systemui.statusbar.notification.collection.legacy.VisualStabilityManager;
import com.android.systemui.statusbar.notification.collection.notifcollection.DismissedByUserStats;
@@ -688,11 +687,6 @@ public class NotificationStackScrollLayoutController {
        groupManager.registerGroupExpansionChangeListener(
                (changedRow, expanded) -> mView.onGroupExpandChanged(changedRow, expanded));
        legacyGroupManager.registerGroupChangeListener(new OnGroupChangeListener() {
            @Override
            public void onGroupCreatedFromChildren(NotificationGroup group) {
                mStatusBar.requestNotificationUpdate("onGroupCreatedFromChildren");
            }

            @Override
            public void onGroupsChanged() {
                mStatusBar.requestNotificationUpdate("onGroupsChanged");
+34 −13

File changed.

Preview size limit exceeded, changes collapsed.

+294 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading