Merge "Set textChanged for new notifications" into sc-v2-dev
This commit is contained in:
@@ -7067,7 +7067,9 @@ public class NotificationManagerService extends SystemService {
|
|||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
mNotificationList.add(r);
|
mNotificationList.add(r);
|
||||||
mUsageStats.registerPostedByApp(r);
|
mUsageStats.registerPostedByApp(r);
|
||||||
r.setInterruptive(isVisuallyInterruptive(null, r));
|
final boolean isInterruptive = isVisuallyInterruptive(null, r);
|
||||||
|
r.setInterruptive(isInterruptive);
|
||||||
|
r.setTextChanged(isInterruptive);
|
||||||
} else {
|
} else {
|
||||||
old = mNotificationList.get(index); // Potentially *changes* old
|
old = mNotificationList.get(index); // Potentially *changes* old
|
||||||
mNotificationList.set(index, r);
|
mNotificationList.set(index, r);
|
||||||
|
|||||||
@@ -3871,6 +3871,19 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
|
|||||||
r.getStats().getDismissalSentiment());
|
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
|
@Test
|
||||||
public void testVisuallyInterruptive_notSeen() throws Exception {
|
public void testVisuallyInterruptive_notSeen() throws Exception {
|
||||||
NotificationRecord original = generateNotificationRecord(mTestNotificationChannel);
|
NotificationRecord original = generateNotificationRecord(mTestNotificationChannel);
|
||||||
|
|||||||
Reference in New Issue
Block a user