Loading services/core/java/com/android/server/notification/PreferencesHelper.java +4 −2 Original line number Diff line number Diff line Loading @@ -1925,8 +1925,10 @@ public class PreferencesHelper implements RankingConfig { conversation.setPkg(r.pkg); conversation.setUid(r.uid); conversation.setNotificationChannel(nc); conversation.setParentChannelLabel( r.channels.get(nc.getParentChannelId()).getName()); NotificationChannel parent = r.channels.get(nc.getParentChannelId()); conversation.setParentChannelLabel(parent == null ? null : parent.getName()); boolean blockedByGroup = false; if (nc.getGroup() != null) { NotificationChannelGroup group = r.groups.get(nc.getGroup()); Loading services/tests/uiservicestests/src/com/android/server/notification/PreferencesHelperTest.java +5 −0 Original line number Diff line number Diff line Loading @@ -5495,6 +5495,11 @@ public class PreferencesHelperTest extends UiServiceTestCase { assertEquals(1, convos.size()); assertTrue(conversationWrapperContainsChannel(convos, channel)); // Also test the getConversations(pkg, uid) API List<ConversationChannelWrapper> convosByPkgUid = mHelper.getConversations(PKG_O, UID_O); assertEquals(1, convos.size()); assertTrue(conversationWrapperContainsChannel(convos, channel)); } private boolean conversationWrapperContainsChannel(List<ConversationChannelWrapper> list, Loading Loading
services/core/java/com/android/server/notification/PreferencesHelper.java +4 −2 Original line number Diff line number Diff line Loading @@ -1925,8 +1925,10 @@ public class PreferencesHelper implements RankingConfig { conversation.setPkg(r.pkg); conversation.setUid(r.uid); conversation.setNotificationChannel(nc); conversation.setParentChannelLabel( r.channels.get(nc.getParentChannelId()).getName()); NotificationChannel parent = r.channels.get(nc.getParentChannelId()); conversation.setParentChannelLabel(parent == null ? null : parent.getName()); boolean blockedByGroup = false; if (nc.getGroup() != null) { NotificationChannelGroup group = r.groups.get(nc.getGroup()); Loading
services/tests/uiservicestests/src/com/android/server/notification/PreferencesHelperTest.java +5 −0 Original line number Diff line number Diff line Loading @@ -5495,6 +5495,11 @@ public class PreferencesHelperTest extends UiServiceTestCase { assertEquals(1, convos.size()); assertTrue(conversationWrapperContainsChannel(convos, channel)); // Also test the getConversations(pkg, uid) API List<ConversationChannelWrapper> convosByPkgUid = mHelper.getConversations(PKG_O, UID_O); assertEquals(1, convos.size()); assertTrue(conversationWrapperContainsChannel(convos, channel)); } private boolean conversationWrapperContainsChannel(List<ConversationChannelWrapper> list, Loading