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
This commit is contained in:
@@ -7247,7 +7247,9 @@ public class NotificationManagerService extends SystemService {
|
||||
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);
|
||||
|
||||
@@ -3858,6 +3858,19 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
|
||||
r.getStats().getDismissalSentiment());
|
||||
}
|
||||
|
||||
@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);
|
||||
|
||||
Reference in New Issue
Block a user