Loading core/java/android/app/NotificationManager.java +2 −1 Original line number Diff line number Diff line Loading @@ -424,7 +424,8 @@ public class NotificationManager * This is a no-op for channels that already exist. * * @param channel the channel to create. Note that the created channel may differ from this * value. If the channel already exists, it will not be modified. * value. If the provided channel is malformed, a RemoteException will be * thrown. If the channel already exists, it will not be modified. */ public void createNotificationChannel(@NonNull NotificationChannel channel) { createNotificationChannels(Arrays.asList(channel)); Loading services/core/java/com/android/server/notification/RankingHelper.java +0 −3 Original line number Diff line number Diff line Loading @@ -510,9 +510,6 @@ public class RankingHelper implements RankingConfig { if (r == null) { throw new IllegalArgumentException("Invalid package"); } if (IMPORTANCE_NONE == r.importance) { throw new IllegalArgumentException("Package blocked"); } if (channel.getGroup() != null && !r.groups.containsKey(channel.getGroup())) { throw new IllegalArgumentException("NotificationChannelGroup doesn't exist"); } Loading services/tests/notification/src/com/android/server/notification/RankingHelperTest.java +2 −7 Original line number Diff line number Diff line Loading @@ -427,13 +427,8 @@ public class RankingHelperTest { public void testCreateChannel_blocked() throws Exception { mHelper.setImportance(pkg, uid, NotificationManager.IMPORTANCE_NONE); try { mHelper.createNotificationChannel(pkg, uid, new NotificationChannel(pkg, "", IMPORTANCE_LOW), true); fail("Channel creation should fail"); } catch (IllegalArgumentException e) { // pass } new NotificationChannel(pkg, "bananas", IMPORTANCE_LOW), true); } @Test Loading Loading
core/java/android/app/NotificationManager.java +2 −1 Original line number Diff line number Diff line Loading @@ -424,7 +424,8 @@ public class NotificationManager * This is a no-op for channels that already exist. * * @param channel the channel to create. Note that the created channel may differ from this * value. If the channel already exists, it will not be modified. * value. If the provided channel is malformed, a RemoteException will be * thrown. If the channel already exists, it will not be modified. */ public void createNotificationChannel(@NonNull NotificationChannel channel) { createNotificationChannels(Arrays.asList(channel)); Loading
services/core/java/com/android/server/notification/RankingHelper.java +0 −3 Original line number Diff line number Diff line Loading @@ -510,9 +510,6 @@ public class RankingHelper implements RankingConfig { if (r == null) { throw new IllegalArgumentException("Invalid package"); } if (IMPORTANCE_NONE == r.importance) { throw new IllegalArgumentException("Package blocked"); } if (channel.getGroup() != null && !r.groups.containsKey(channel.getGroup())) { throw new IllegalArgumentException("NotificationChannelGroup doesn't exist"); } Loading
services/tests/notification/src/com/android/server/notification/RankingHelperTest.java +2 −7 Original line number Diff line number Diff line Loading @@ -427,13 +427,8 @@ public class RankingHelperTest { public void testCreateChannel_blocked() throws Exception { mHelper.setImportance(pkg, uid, NotificationManager.IMPORTANCE_NONE); try { mHelper.createNotificationChannel(pkg, uid, new NotificationChannel(pkg, "", IMPORTANCE_LOW), true); fail("Channel creation should fail"); } catch (IllegalArgumentException e) { // pass } new NotificationChannel(pkg, "bananas", IMPORTANCE_LOW), true); } @Test Loading