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

Commit f1c00cf3 authored by Julia Reynolds's avatar Julia Reynolds Committed by Android (Google) Code Review
Browse files

Merge "Send ranking update on importance change."

parents 4e379c14 69766695
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -2840,17 +2840,20 @@ public class NotificationManagerService extends SystemService {
            final int N = mNotificationList.size();
            ArrayList<String> orderBefore = new ArrayList<String>(N);
            int[] visibilities = new int[N];
            int [] importances = new int[N];
            for (int i = 0; i < N; i++) {
                final NotificationRecord r = mNotificationList.get(i);
                orderBefore.add(r.getKey());
                visibilities[i] = r.getPackageVisibilityOverride();
                importances[i] = r.getImportance();
                mRankingHelper.extractSignals(r);
            }
            mRankingHelper.sort(mNotificationList);
            for (int i = 0; i < N; i++) {
                final NotificationRecord r = mNotificationList.get(i);
                if (!orderBefore.get(i).equals(r.getKey())
                        || visibilities[i] != r.getPackageVisibilityOverride()) {
                        || visibilities[i] != r.getPackageVisibilityOverride()
                        || importances[i] != r.getImportance()) {
                    scheduleSendRankingUpdate();
                    return;
                }