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

Commit 1fba2a62 authored by Mady Mellor's avatar Mady Mellor Committed by Android (Google) Code Review
Browse files

Merge "NotificationEntryListener: pre & post onEntryUpdated"

parents ccee30ed 0ad5b9de
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ public class ForegroundServiceNotificationListener {
            }

            @Override
            public void onEntryUpdated(NotificationEntry entry) {
            public void onPostEntryUpdated(NotificationEntry entry) {
                updateNotification(entry.notification, entry.importance);
            }

+1 −1
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ public class NotificationAlertingManager {
            }

            @Override
            public void onEntryUpdated(NotificationEntry entry) {
            public void onPostEntryUpdated(NotificationEntry entry) {
                updateAlertState(entry);
            }

+8 −2
Original line number Diff line number Diff line
@@ -40,9 +40,15 @@ public interface NotificationEntryListener {
    }

    /**
     * Called when a notification was updated.
     * Called when a notification is updated, before any filtering of notifications have occurred.
     */
    default void onEntryUpdated(NotificationEntry entry) {
    default void onPreEntryUpdated(NotificationEntry entry) {
    }

    /**
     * Called when a notification was updated, after any filtering of notifications have occurred.
     */
    default void onPostEntryUpdated(NotificationEntry entry) {
    }

    /**
+5 −1
Original line number Diff line number Diff line
@@ -447,6 +447,10 @@ public class NotificationEntryManager implements
        getRowBinder().inflateViews(entry, () -> performRemoveNotification(notification),
                mNotificationData.get(entry.key) != null);

        for (NotificationEntryListener listener : mNotificationEntryListeners) {
            listener.onPreEntryUpdated(entry);
        }

        updateNotifications();

        if (DEBUG) {
@@ -457,7 +461,7 @@ public class NotificationEntryManager implements
        }

        for (NotificationEntryListener listener : mNotificationEntryListeners) {
            listener.onEntryUpdated(entry);
            listener.onPostEntryUpdated(entry);
        }

        maybeScheduleUpdateNotificationViews(entry);
+1 −1
Original line number Diff line number Diff line
@@ -521,7 +521,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd

        mEntryManager.addNotificationEntryListener(new NotificationEntryListener() {
            @Override
            public void onEntryUpdated(NotificationEntry entry) {
            public void onPostEntryUpdated(NotificationEntry entry) {
                if (!entry.notification.isClearable()) {
                    // The user may have performed a dismiss action on the notification, since it's
                    // not clearable we should snap it back.
Loading