commit | 80027b1362f3e153fa6d622329d7b84198da5125 | [log] [tgz] |
---|---|---|
author | Mady Mellor <madym@google.com> | Wed Nov 17 22:55:49 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Wed Nov 17 22:55:49 2021 +0000 |
tree | d3e97f7cf053d4ec806a1040b820b831c5e5901b | |
parent | 99c031d89f6057c0cab892edc453b1c5523e09c0 [diff] | |
parent | 1bdbab8f3e92f918d780aa9c5ff0e6b90a0f7308 [diff] |
Merge "Set textChanged for new notifications" into sc-v2-dev am: cb9b8086fe am: 1bdbab8f3e Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16266490 Change-Id: Ic0b5bf70016808a9c827aadbe867777502aa02bc
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index e41b994..bde5543 100755 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -7247,7 +7247,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 31e7ad0..5808964 100755 --- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java +++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
@@ -3859,6 +3859,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);