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

Commit 1bdbab8f authored by Mady Mellor's avatar Mady Mellor Committed by Automerger Merge Worker
Browse files

Merge "Set textChanged for new notifications" into sc-v2-dev am: cb9b8086

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16266490

Change-Id: Iaeb58a71acb5a11035bf53f0def26954a9dc13c3
parents 68ba86d2 cb9b8086
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -7067,7 +7067,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);
+13 −0
Original line number Diff line number Diff line
@@ -3871,6 +3871,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);