Fix applyAdjustmentsFromAssistants
Issue: r.applyAdjustments() updates the NotificationRecord from the
adjustments, which makes handleRankingSort failed to diff
the NotificationRecord properly as it is already updated
Solution: Only update the importance bit in applyAdjustmentsFromAssistants
Test: runtest systemui-notification
Test: Posted a notification, observe smart replies. Reboot, still
seeing the smart replies.
FIXES: 118886848
Change-Id: I3757d29ef4a28a2b55be06c331f8fcf702caf61a
diff --git a/services/core/java/com/android/server/notification/NotificationRecord.java b/services/core/java/com/android/server/notification/NotificationRecord.java
index 84d0c01..a11b03f 100644
--- a/services/core/java/com/android/server/notification/NotificationRecord.java
+++ b/services/core/java/com/android/server/notification/NotificationRecord.java
@@ -664,6 +664,18 @@
.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);