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

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

Merge "Fix applyAdjustmentsFromAssistants"

parents b8bb293e 8a8ddadf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3610,7 +3610,7 @@ public class NotificationManagerService extends SystemService {
                        NotificationRecord r = mNotificationsByKey.get(adjustment.getKey());
                        if (r != null && mAssistants.isSameUser(token, r.getUserId())) {
                            applyAdjustment(r, adjustment);
                            r.applyAdjustments();
                            r.applyImportanceFromAdjustments();
                            if (r.getImportance() == IMPORTANCE_NONE) {
                                cancelNotificationsFromListener(token, new String[]{r.getKey()});
                            } else {
+12 −0
Original line number Diff line number Diff line
@@ -664,6 +664,18 @@ public final class NotificationRecord {
                            .addTaggedData(MetricsEvent.ADJUSTMENT_KEY_SMART_REPLIES,
                                    getSmartReplies().size()));
                }
            }
            applyImportanceFromAdjustments();
        }
    }

    /**
     * Update importance from the adjustment.
     */
    public void applyImportanceFromAdjustments() {
        synchronized (mAdjustments) {
            for (Adjustment adjustment : mAdjustments) {
                Bundle signals = adjustment.getSignals();
                if (signals.containsKey(Adjustment.KEY_IMPORTANCE)) {
                    int importance = signals.getInt(Adjustment.KEY_IMPORTANCE);
                    importance = Math.max(IMPORTANCE_UNSPECIFIED, importance);