commit | 1bdbab8f3e92f918d780aa9c5ff0e6b90a0f7308 | [log] [tgz] |
---|---|---|
author | Mady Mellor <madym@google.com> | Wed Nov 17 19:24:24 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Wed Nov 17 19:24:24 2021 +0000 |
tree | 90eca376be2b2caa7b11dd4c28c9972668f71ff3 | |
parent | 68ba86d23cc484eb3e0302558d73d0981c210d61 [diff] | |
parent | cb9b8086feff1e25331fe86b2d678f55b10ef674 [diff] |
Merge "Set textChanged for new notifications" into sc-v2-dev am: cb9b8086fe Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16266490 Change-Id: Iaeb58a71acb5a11035bf53f0def26954a9dc13c3
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index e597972..7ed897d 100755 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -7067,7 +7067,9 @@ if (index < 0) { mNotificationList.add(r); mUsageStats.registerPostedByApp(r); - r.setInterruptive(isVisuallyInterruptive(null, r)); + final boolean isInterruptive = isVisuallyInterruptive(null, r); + r.setInterruptive(isInterruptive); + r.setTextChanged(isInterruptive); } else { old = mNotificationList.get(index); // Potentially *changes* old mNotificationList.set(index, r);
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java index c493639..0ad119d 100755 --- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java +++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
@@ -3872,6 +3872,19 @@ } @Test + public void testTextChangedSet_forNewNotifs() throws Exception { + NotificationRecord original = generateNotificationRecord(mTestNotificationChannel); + mService.addEnqueuedNotification(original); + + NotificationManagerService.PostNotificationRunnable runnable = + mService.new PostNotificationRunnable(original.getKey()); + runnable.run(); + waitForIdle(); + + assertTrue(original.isTextChanged()); + } + + @Test public void testVisuallyInterruptive_notSeen() throws Exception { NotificationRecord original = generateNotificationRecord(mTestNotificationChannel); mService.addNotification(original);