Loading services/core/java/com/android/server/notification/NotificationManagerService.java +11 −9 Original line number Diff line number Diff line Loading @@ -3590,14 +3590,16 @@ public class NotificationManagerService extends SystemService { } if (notificationForceGrouping()) { final NotificationChannel updatedChannel = mPreferencesHelper.getNotificationChannel( pkg, uid, channel.getId(), false); mHandler.postDelayed(() -> { final NotificationChannel updatedChannel = mPreferencesHelper .getNotificationChannel(pkg, uid, channel.getId(), false); synchronized (mNotificationLock) { if (updatedChannel != null) { mGroupHelper.onChannelUpdated( UserHandle.getUserHandleForUid(uid).getIdentifier(), pkg, updatedChannel, mNotificationList, mSummaryByGroupKey); } } }, DELAY_FORCE_REGROUP_TIME); } Loading services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java +18 −0 Original line number Diff line number Diff line Loading @@ -2866,6 +2866,24 @@ public class NotificationManagerServiceTest extends UiServiceTestCase { eq(mPkg), eq(mTestNotificationChannel), any(), any()); } @Test @EnableFlags(FLAG_NOTIFICATION_FORCE_GROUPING) public void testUpdateDeletedChannel_notifyGroupHelper() throws Exception { mService.setPreferencesHelper(mPreferencesHelper); mTestNotificationChannel.setLightColor(Color.CYAN); when(mPreferencesHelper.getNotificationChannel(eq(mPkg), anyInt(), eq(mTestNotificationChannel.getId()), eq(true))) .thenReturn(mTestNotificationChannel); when(mPreferencesHelper.getNotificationChannel(eq(mPkg), anyInt(), eq(mTestNotificationChannel.getId()), eq(false))) .thenReturn(null); mBinderService.updateNotificationChannelForPackage(mPkg, mUid, mTestNotificationChannel); mTestableLooper.moveTimeForward(DELAY_FORCE_REGROUP_TIME); waitForIdle(); verify(mGroupHelper, never()).onChannelUpdated(anyInt(), anyString(), any(), any(), any()); } @Test @EnableFlags(FLAG_NOTIFICATION_FORCE_GROUPING) public void testSnoozeRunnable_snoozeAggregateGroupChild_summaryNotSnoozed() throws Exception { Loading Loading
services/core/java/com/android/server/notification/NotificationManagerService.java +11 −9 Original line number Diff line number Diff line Loading @@ -3590,14 +3590,16 @@ public class NotificationManagerService extends SystemService { } if (notificationForceGrouping()) { final NotificationChannel updatedChannel = mPreferencesHelper.getNotificationChannel( pkg, uid, channel.getId(), false); mHandler.postDelayed(() -> { final NotificationChannel updatedChannel = mPreferencesHelper .getNotificationChannel(pkg, uid, channel.getId(), false); synchronized (mNotificationLock) { if (updatedChannel != null) { mGroupHelper.onChannelUpdated( UserHandle.getUserHandleForUid(uid).getIdentifier(), pkg, updatedChannel, mNotificationList, mSummaryByGroupKey); } } }, DELAY_FORCE_REGROUP_TIME); } Loading
services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java +18 −0 Original line number Diff line number Diff line Loading @@ -2866,6 +2866,24 @@ public class NotificationManagerServiceTest extends UiServiceTestCase { eq(mPkg), eq(mTestNotificationChannel), any(), any()); } @Test @EnableFlags(FLAG_NOTIFICATION_FORCE_GROUPING) public void testUpdateDeletedChannel_notifyGroupHelper() throws Exception { mService.setPreferencesHelper(mPreferencesHelper); mTestNotificationChannel.setLightColor(Color.CYAN); when(mPreferencesHelper.getNotificationChannel(eq(mPkg), anyInt(), eq(mTestNotificationChannel.getId()), eq(true))) .thenReturn(mTestNotificationChannel); when(mPreferencesHelper.getNotificationChannel(eq(mPkg), anyInt(), eq(mTestNotificationChannel.getId()), eq(false))) .thenReturn(null); mBinderService.updateNotificationChannelForPackage(mPkg, mUid, mTestNotificationChannel); mTestableLooper.moveTimeForward(DELAY_FORCE_REGROUP_TIME); waitForIdle(); verify(mGroupHelper, never()).onChannelUpdated(anyInt(), anyString(), any(), any(), any()); } @Test @EnableFlags(FLAG_NOTIFICATION_FORCE_GROUPING) public void testSnoozeRunnable_snoozeAggregateGroupChild_summaryNotSnoozed() throws Exception { Loading