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

Commit 888f39f8 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Updates notification row when importance changes."

parents b53030f9 33fbc15f
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -952,10 +952,12 @@ public class NotificationEntryManager implements Dumpable, NotificationInflater.

        // Has a copy of the current UI adjustments.
        ArrayMap<String, NotificationUiAdjustment> oldAdjustments = new ArrayMap<>();
        ArrayMap<String, Integer> oldImportances = new ArrayMap<>();
        for (NotificationData.Entry entry : entries) {
            NotificationUiAdjustment adjustment =
                    NotificationUiAdjustment.extractFromNotificationEntry(entry);
            oldAdjustments.put(entry.key, adjustment);
            oldImportances.put(entry.key, entry.importance);
        }

        // Populate notification entries from the new rankings.
@@ -978,6 +980,11 @@ public class NotificationEntryManager implements Dumpable, NotificationInflater.
                    // Once the RowInflaterTask is done, it will pick up the updated entry, so
                    // no-op here.
                }
            } else if (oldImportances.containsKey(entry.key)
                    && entry.importance != oldImportances.get(entry.key)) {
                if (entry.rowExists()) {
                    entry.getRow().onNotificationRankingUpdated();
                }
            }
        }

+7 −0
Original line number Diff line number Diff line
@@ -588,6 +588,13 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
        updateRippleAllowed();
    }

    /** Called when the notification's ranking was changed (but nothing else changed). */
    public void onNotificationRankingUpdated() {
        if (mMenuRow != null) {
            mMenuRow.onNotificationUpdated(mStatusBarNotification);
        }
    }

    @VisibleForTesting
    void updateShelfIconColor() {
        StatusBarIconView expandedIcon = mEntry.expandedIcon;