Loading services/core/java/com/android/server/notification/NotificationManagerService.java +3 −3 Original line number Diff line number Diff line Loading @@ -4998,8 +4998,8 @@ public class NotificationManagerService extends SystemService { getNotificationChannelGroupsWithoutChannels(String pkg) { checkCallerIsSystemOrSameApp(pkg); List<NotificationChannelGroup> groups = new ArrayList<>(); groups.addAll( mPreferencesHelper.getNotificationChannelGroups(pkg, Binder.getCallingUid())); groups.addAll(mPreferencesHelper.getNotificationChannelGroupsWithoutChannels(pkg, Binder.getCallingUid())); return new ParceledListSlice<>(groups); } Loading Loading @@ -7146,7 +7146,7 @@ public class NotificationManagerService extends SystemService { verifyPrivilegedListener(token, user, true); List<NotificationChannelGroup> groups = new ArrayList<>(); groups.addAll(mPreferencesHelper.getNotificationChannelGroups( groups.addAll(mPreferencesHelper.getNotificationChannelGroupsWithoutChannels( pkg, getUidForPackageAndUser(pkg, user))); return new ParceledListSlice<>(groups); } Loading services/core/java/com/android/server/notification/PreferencesHelper.java +2 −2 Original line number Diff line number Diff line Loading @@ -1764,8 +1764,8 @@ public class PreferencesHelper implements RankingConfig { * structure; do not modify the returned groups before copying or parceling. */ @Override public Collection<NotificationChannelGroup> getNotificationChannelGroups(String pkg, int uid) { public Collection<NotificationChannelGroup> getNotificationChannelGroupsWithoutChannels( String pkg, int uid) { List<NotificationChannelGroup> groups = new ArrayList<>(); synchronized (mLock) { PackagePreferences r = getPackagePreferencesLocked(pkg, uid); Loading services/core/java/com/android/server/notification/RankingConfig.java +1 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ public interface RankingConfig { boolean canShowNotificationsOnLockscreen(int userId); boolean canShowPrivateNotificationsOnLockScreen(int userId); Collection<NotificationChannelGroup> getNotificationChannelGroups(String pkg, Collection<NotificationChannelGroup> getNotificationChannelGroupsWithoutChannels(String pkg, int uid); void createNotificationChannelGroup(String pkg, int uid, NotificationChannelGroup group, boolean fromTargetApp, int callingUid, boolean isSystemOrSystemUi); Loading services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java +6 −3 Original line number Diff line number Diff line Loading @@ -5339,7 +5339,8 @@ public class NotificationManagerServiceTest extends UiServiceTestCase { mBinderService.getNotificationChannelGroupsFromPrivilegedListener( null, mPkg, Process.myUserHandle()); verify(mPreferencesHelper, times(1)).getNotificationChannelGroups(anyString(), anyInt()); verify(mPreferencesHelper, times(1)).getNotificationChannelGroupsWithoutChannels( anyString(), anyInt()); } @Test Loading @@ -5356,7 +5357,8 @@ public class NotificationManagerServiceTest extends UiServiceTestCase { // pass } verify(mPreferencesHelper, never()).getNotificationChannelGroups(anyString(), anyInt()); verify(mPreferencesHelper, never()).getNotificationChannelGroupsWithoutChannels(anyString(), anyInt()); } @Test Loading @@ -5376,7 +5378,8 @@ public class NotificationManagerServiceTest extends UiServiceTestCase { // pass } verify(mPreferencesHelper, never()).getNotificationChannelGroups(anyString(), anyInt()); verify(mPreferencesHelper, never()).getNotificationChannelGroupsWithoutChannels(anyString(), anyInt()); } @Test Loading services/tests/uiservicestests/src/com/android/server/notification/PreferencesHelperTest.java +5 −4 Original line number Diff line number Diff line Loading @@ -3314,7 +3314,8 @@ public class PreferencesHelperTest extends UiServiceTestCase { PKG_N_MR1, UID_N_MR1, nonGroupedNonDeletedChannel.getId(), false)); // notDeleted assertEquals(1, mHelper.getNotificationChannelGroups(PKG_N_MR1, UID_N_MR1).size()); assertEquals(1, mHelper.getNotificationChannelGroups(PKG_N_MR1, UID_N_MR1, NotificationChannelGroupsHelper.Params.forAllGroups()).getList().size()); verify(mHandler, never()).requestSort(); Loading Loading @@ -3474,7 +3475,7 @@ public class PreferencesHelperTest extends UiServiceTestCase { assertNull(mHelper.getNotificationDelegate(PKG_O, UID_O)); assertEquals(0, mHelper.getAppLockedFields(PKG_O, UID_O)); assertEquals(0, mHelper.getRemovedPkgNotificationChannels(PKG_O, UID_O).size()); assertEquals(0, mHelper.getNotificationChannelGroups(PKG_O, UID_O).size()); assertEquals(0, mHelper.getNotificationChannelGroupsWithoutChannels(PKG_O, UID_O).size()); NotificationChannel channel = getChannel(); mHelper.createNotificationChannel(PKG_O, UID_O, channel, true, false, Loading @@ -3496,8 +3497,8 @@ public class PreferencesHelperTest extends UiServiceTestCase { NotificationChannelGroup ncg = new NotificationChannelGroup("group1", "name1"); mHelper.createNotificationChannelGroup(PKG_N_MR1, UID_N_MR1, ncg, true, UID_N_MR1, false); assertEquals(ncg, mHelper.getNotificationChannelGroups(PKG_N_MR1, UID_N_MR1).iterator().next()); assertEquals(ncg, mHelper.getNotificationChannelGroupsWithoutChannels(PKG_N_MR1, UID_N_MR1).iterator().next()); verify(mHandler, never()).requestSort(); assertEquals(1, mLogger.getCalls().size()); assertEquals( Loading Loading
services/core/java/com/android/server/notification/NotificationManagerService.java +3 −3 Original line number Diff line number Diff line Loading @@ -4998,8 +4998,8 @@ public class NotificationManagerService extends SystemService { getNotificationChannelGroupsWithoutChannels(String pkg) { checkCallerIsSystemOrSameApp(pkg); List<NotificationChannelGroup> groups = new ArrayList<>(); groups.addAll( mPreferencesHelper.getNotificationChannelGroups(pkg, Binder.getCallingUid())); groups.addAll(mPreferencesHelper.getNotificationChannelGroupsWithoutChannels(pkg, Binder.getCallingUid())); return new ParceledListSlice<>(groups); } Loading Loading @@ -7146,7 +7146,7 @@ public class NotificationManagerService extends SystemService { verifyPrivilegedListener(token, user, true); List<NotificationChannelGroup> groups = new ArrayList<>(); groups.addAll(mPreferencesHelper.getNotificationChannelGroups( groups.addAll(mPreferencesHelper.getNotificationChannelGroupsWithoutChannels( pkg, getUidForPackageAndUser(pkg, user))); return new ParceledListSlice<>(groups); } Loading
services/core/java/com/android/server/notification/PreferencesHelper.java +2 −2 Original line number Diff line number Diff line Loading @@ -1764,8 +1764,8 @@ public class PreferencesHelper implements RankingConfig { * structure; do not modify the returned groups before copying or parceling. */ @Override public Collection<NotificationChannelGroup> getNotificationChannelGroups(String pkg, int uid) { public Collection<NotificationChannelGroup> getNotificationChannelGroupsWithoutChannels( String pkg, int uid) { List<NotificationChannelGroup> groups = new ArrayList<>(); synchronized (mLock) { PackagePreferences r = getPackagePreferencesLocked(pkg, uid); Loading
services/core/java/com/android/server/notification/RankingConfig.java +1 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ public interface RankingConfig { boolean canShowNotificationsOnLockscreen(int userId); boolean canShowPrivateNotificationsOnLockScreen(int userId); Collection<NotificationChannelGroup> getNotificationChannelGroups(String pkg, Collection<NotificationChannelGroup> getNotificationChannelGroupsWithoutChannels(String pkg, int uid); void createNotificationChannelGroup(String pkg, int uid, NotificationChannelGroup group, boolean fromTargetApp, int callingUid, boolean isSystemOrSystemUi); Loading
services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java +6 −3 Original line number Diff line number Diff line Loading @@ -5339,7 +5339,8 @@ public class NotificationManagerServiceTest extends UiServiceTestCase { mBinderService.getNotificationChannelGroupsFromPrivilegedListener( null, mPkg, Process.myUserHandle()); verify(mPreferencesHelper, times(1)).getNotificationChannelGroups(anyString(), anyInt()); verify(mPreferencesHelper, times(1)).getNotificationChannelGroupsWithoutChannels( anyString(), anyInt()); } @Test Loading @@ -5356,7 +5357,8 @@ public class NotificationManagerServiceTest extends UiServiceTestCase { // pass } verify(mPreferencesHelper, never()).getNotificationChannelGroups(anyString(), anyInt()); verify(mPreferencesHelper, never()).getNotificationChannelGroupsWithoutChannels(anyString(), anyInt()); } @Test Loading @@ -5376,7 +5378,8 @@ public class NotificationManagerServiceTest extends UiServiceTestCase { // pass } verify(mPreferencesHelper, never()).getNotificationChannelGroups(anyString(), anyInt()); verify(mPreferencesHelper, never()).getNotificationChannelGroupsWithoutChannels(anyString(), anyInt()); } @Test Loading
services/tests/uiservicestests/src/com/android/server/notification/PreferencesHelperTest.java +5 −4 Original line number Diff line number Diff line Loading @@ -3314,7 +3314,8 @@ public class PreferencesHelperTest extends UiServiceTestCase { PKG_N_MR1, UID_N_MR1, nonGroupedNonDeletedChannel.getId(), false)); // notDeleted assertEquals(1, mHelper.getNotificationChannelGroups(PKG_N_MR1, UID_N_MR1).size()); assertEquals(1, mHelper.getNotificationChannelGroups(PKG_N_MR1, UID_N_MR1, NotificationChannelGroupsHelper.Params.forAllGroups()).getList().size()); verify(mHandler, never()).requestSort(); Loading Loading @@ -3474,7 +3475,7 @@ public class PreferencesHelperTest extends UiServiceTestCase { assertNull(mHelper.getNotificationDelegate(PKG_O, UID_O)); assertEquals(0, mHelper.getAppLockedFields(PKG_O, UID_O)); assertEquals(0, mHelper.getRemovedPkgNotificationChannels(PKG_O, UID_O).size()); assertEquals(0, mHelper.getNotificationChannelGroups(PKG_O, UID_O).size()); assertEquals(0, mHelper.getNotificationChannelGroupsWithoutChannels(PKG_O, UID_O).size()); NotificationChannel channel = getChannel(); mHelper.createNotificationChannel(PKG_O, UID_O, channel, true, false, Loading @@ -3496,8 +3497,8 @@ public class PreferencesHelperTest extends UiServiceTestCase { NotificationChannelGroup ncg = new NotificationChannelGroup("group1", "name1"); mHelper.createNotificationChannelGroup(PKG_N_MR1, UID_N_MR1, ncg, true, UID_N_MR1, false); assertEquals(ncg, mHelper.getNotificationChannelGroups(PKG_N_MR1, UID_N_MR1).iterator().next()); assertEquals(ncg, mHelper.getNotificationChannelGroupsWithoutChannels(PKG_N_MR1, UID_N_MR1).iterator().next()); verify(mHandler, never()).requestSort(); assertEquals(1, mLogger.getCalls().size()); assertEquals( Loading