Loading services/core/java/com/android/server/notification/NotificationManagerService.java +4 −3 Original line number Diff line number Diff line Loading @@ -12018,6 +12018,10 @@ public class NotificationManagerService extends SystemService { if (record != null && (record.getSbn().getNotification().flags & FLAG_LIFETIME_EXTENDED_BY_DIRECT_REPLY) > 0 && !record.isCanceledAfterLifetimeExtension()) { // Mark that the notification is being updated due to cancelation, so it won't // be updated again if the app cancels multiple times. record.setCanceledAfterLifetimeExtension(true); boolean isAppForeground = pkg != null && packageImportance == IMPORTANCE_FOREGROUND; // Save the original Record's post silently value, so we can restore it after we send Loading @@ -12033,9 +12037,6 @@ public class NotificationManagerService extends SystemService { PostNotificationTracker tracker = mPostNotificationTrackerFactory.newTracker(null); tracker.addCleanupRunnable(() -> { synchronized (mNotificationLock) { // Mark that the notification has been updated due to cancelation, so it won't // be updated again if the app cancels multiple times. record.setCanceledAfterLifetimeExtension(true); // Set the post silently status to the record's previous value. record.setPostSilently(savedPostSilentlyState); // Remove FLAG_ONLY_ALERT_ONCE if the notification did not previously have it. services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java +0 −1 Original line number Diff line number Diff line Loading @@ -3206,7 +3206,6 @@ public class NotificationManagerServiceTest extends UiServiceTestCase { // Send two cancelations. mBinderService.cancelNotificationWithTag(mPkg, mPkg, sbn.getTag(), sbn.getId(), sbn.getUserId()); waitForIdle(); mBinderService.cancelNotificationWithTag(mPkg, mPkg, sbn.getTag(), sbn.getId(), sbn.getUserId()); waitForIdle(); Loading Loading
services/core/java/com/android/server/notification/NotificationManagerService.java +4 −3 Original line number Diff line number Diff line Loading @@ -12018,6 +12018,10 @@ public class NotificationManagerService extends SystemService { if (record != null && (record.getSbn().getNotification().flags & FLAG_LIFETIME_EXTENDED_BY_DIRECT_REPLY) > 0 && !record.isCanceledAfterLifetimeExtension()) { // Mark that the notification is being updated due to cancelation, so it won't // be updated again if the app cancels multiple times. record.setCanceledAfterLifetimeExtension(true); boolean isAppForeground = pkg != null && packageImportance == IMPORTANCE_FOREGROUND; // Save the original Record's post silently value, so we can restore it after we send Loading @@ -12033,9 +12037,6 @@ public class NotificationManagerService extends SystemService { PostNotificationTracker tracker = mPostNotificationTrackerFactory.newTracker(null); tracker.addCleanupRunnable(() -> { synchronized (mNotificationLock) { // Mark that the notification has been updated due to cancelation, so it won't // be updated again if the app cancels multiple times. record.setCanceledAfterLifetimeExtension(true); // Set the post silently status to the record's previous value. record.setPostSilently(savedPostSilentlyState); // Remove FLAG_ONLY_ALERT_ONCE if the notification did not previously have it.
services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java +0 −1 Original line number Diff line number Diff line Loading @@ -3206,7 +3206,6 @@ public class NotificationManagerServiceTest extends UiServiceTestCase { // Send two cancelations. mBinderService.cancelNotificationWithTag(mPkg, mPkg, sbn.getTag(), sbn.getId(), sbn.getUserId()); waitForIdle(); mBinderService.cancelNotificationWithTag(mPkg, mPkg, sbn.getTag(), sbn.getId(), sbn.getUserId()); waitForIdle(); Loading