Loading services/core/java/com/android/server/notification/PreferencesHelper.java +1 −0 Original line number Diff line number Diff line Loading @@ -1005,6 +1005,7 @@ public class PreferencesHelper implements RankingConfig { channel.setAllowBubbles(existing != null ? existing.getAllowBubbles() : NotificationChannel.DEFAULT_ALLOW_BUBBLE); channel.setImportantConversation(false); } clearLockedFieldsLocked(channel); Loading services/tests/uiservicestests/src/com/android/server/notification/PreferencesHelperTest.java +8 −6 Original line number Diff line number Diff line Loading @@ -1703,6 +1703,7 @@ public class PreferencesHelperTest extends UiServiceTestCase { channel.setLockscreenVisibility(Notification.VISIBILITY_SECRET); channel.setShowBadge(true); channel.setAllowBubbles(false); channel.setImportantConversation(true); int lockMask = 0; for (int i = 0; i < NotificationChannel.LOCKABLE_FIELDS.length; i++) { lockMask |= NotificationChannel.LOCKABLE_FIELDS[i]; Loading @@ -1718,6 +1719,7 @@ public class PreferencesHelperTest extends UiServiceTestCase { assertEquals(channel.shouldShowLights(), savedChannel.shouldShowLights()); assertFalse(savedChannel.canBypassDnd()); assertFalse(Notification.VISIBILITY_SECRET == savedChannel.getLockscreenVisibility()); assertFalse(channel.isImportantConversation()); assertEquals(channel.canShowBadge(), savedChannel.canShowBadge()); assertEquals(channel.canBubble(), savedChannel.canBubble()); Loading Loading @@ -4396,7 +4398,7 @@ public class PreferencesHelperTest extends UiServiceTestCase { new NotificationChannel("A person calls", "calls from A", IMPORTANCE_DEFAULT); channel2.setConversationId(calls.getId(), convoId); channel2.setImportantConversation(true); mHelper.createNotificationChannel(PKG_O, UID_O, channel2, true, false); mHelper.createNotificationChannel(PKG_O, UID_O, channel2, false, false); List<ConversationChannelWrapper> convos = mHelper.getConversations(IntArray.wrap(new int[] {0}), false); Loading Loading @@ -4473,7 +4475,7 @@ public class PreferencesHelperTest extends UiServiceTestCase { new NotificationChannel("A person calls", "calls from A", IMPORTANCE_DEFAULT); channel2.setConversationId(calls.getId(), convoId); channel2.setImportantConversation(true); mHelper.createNotificationChannel(PKG_O, UID_O, channel2, true, false); mHelper.createNotificationChannel(PKG_O, UID_O, channel2, false, false); List<ConversationChannelWrapper> convos = mHelper.getConversations(IntArray.wrap(new int[] {0}), false); Loading Loading @@ -4501,13 +4503,13 @@ public class PreferencesHelperTest extends UiServiceTestCase { new NotificationChannel("A person msgs", "messages from A", IMPORTANCE_DEFAULT); channel.setConversationId(messages.getId(), convoId); channel.setImportantConversation(true); mHelper.createNotificationChannel(PKG_O, UID_O, channel, true, false); mHelper.createNotificationChannel(PKG_O, UID_O, channel, false, false); NotificationChannel diffConvo = new NotificationChannel("B person msgs", "messages from B", IMPORTANCE_DEFAULT); diffConvo.setConversationId(p.getId(), "different convo"); diffConvo.setImportantConversation(true); mHelper.createNotificationChannel(PKG_P, UID_P, diffConvo, true, false); mHelper.createNotificationChannel(PKG_P, UID_P, diffConvo, false, false); NotificationChannel channel2 = new NotificationChannel("A person calls", "calls from A", IMPORTANCE_DEFAULT); Loading @@ -4534,7 +4536,7 @@ public class PreferencesHelperTest extends UiServiceTestCase { new NotificationChannel("A person msgs", "messages from A", IMPORTANCE_DEFAULT); channel.setConversationId(messages.getId(), convoId); channel.setImportantConversation(true); mHelper.createNotificationChannel(PKG_O, UID_O, channel, true, false); mHelper.createNotificationChannel(PKG_O, UID_O, channel, false, false); mHelper.permanentlyDeleteNotificationChannel(PKG_O, UID_O, "messages"); Loading Loading @@ -4935,7 +4937,7 @@ public class PreferencesHelperTest extends UiServiceTestCase { "conversation", IMPORTANCE_DEFAULT); friend.setConversationId(parent.getId(), "friend"); friend.setImportantConversation(true); mHelper.createNotificationChannel(PKG_O, UID_O, friend, true, false); mHelper.createNotificationChannel(PKG_O, UID_O, friend, false, false); ArrayList<StatsEvent> events = new ArrayList<>(); mHelper.pullPackageChannelPreferencesStats(events); Loading Loading
services/core/java/com/android/server/notification/PreferencesHelper.java +1 −0 Original line number Diff line number Diff line Loading @@ -1005,6 +1005,7 @@ public class PreferencesHelper implements RankingConfig { channel.setAllowBubbles(existing != null ? existing.getAllowBubbles() : NotificationChannel.DEFAULT_ALLOW_BUBBLE); channel.setImportantConversation(false); } clearLockedFieldsLocked(channel); Loading
services/tests/uiservicestests/src/com/android/server/notification/PreferencesHelperTest.java +8 −6 Original line number Diff line number Diff line Loading @@ -1703,6 +1703,7 @@ public class PreferencesHelperTest extends UiServiceTestCase { channel.setLockscreenVisibility(Notification.VISIBILITY_SECRET); channel.setShowBadge(true); channel.setAllowBubbles(false); channel.setImportantConversation(true); int lockMask = 0; for (int i = 0; i < NotificationChannel.LOCKABLE_FIELDS.length; i++) { lockMask |= NotificationChannel.LOCKABLE_FIELDS[i]; Loading @@ -1718,6 +1719,7 @@ public class PreferencesHelperTest extends UiServiceTestCase { assertEquals(channel.shouldShowLights(), savedChannel.shouldShowLights()); assertFalse(savedChannel.canBypassDnd()); assertFalse(Notification.VISIBILITY_SECRET == savedChannel.getLockscreenVisibility()); assertFalse(channel.isImportantConversation()); assertEquals(channel.canShowBadge(), savedChannel.canShowBadge()); assertEquals(channel.canBubble(), savedChannel.canBubble()); Loading Loading @@ -4396,7 +4398,7 @@ public class PreferencesHelperTest extends UiServiceTestCase { new NotificationChannel("A person calls", "calls from A", IMPORTANCE_DEFAULT); channel2.setConversationId(calls.getId(), convoId); channel2.setImportantConversation(true); mHelper.createNotificationChannel(PKG_O, UID_O, channel2, true, false); mHelper.createNotificationChannel(PKG_O, UID_O, channel2, false, false); List<ConversationChannelWrapper> convos = mHelper.getConversations(IntArray.wrap(new int[] {0}), false); Loading Loading @@ -4473,7 +4475,7 @@ public class PreferencesHelperTest extends UiServiceTestCase { new NotificationChannel("A person calls", "calls from A", IMPORTANCE_DEFAULT); channel2.setConversationId(calls.getId(), convoId); channel2.setImportantConversation(true); mHelper.createNotificationChannel(PKG_O, UID_O, channel2, true, false); mHelper.createNotificationChannel(PKG_O, UID_O, channel2, false, false); List<ConversationChannelWrapper> convos = mHelper.getConversations(IntArray.wrap(new int[] {0}), false); Loading Loading @@ -4501,13 +4503,13 @@ public class PreferencesHelperTest extends UiServiceTestCase { new NotificationChannel("A person msgs", "messages from A", IMPORTANCE_DEFAULT); channel.setConversationId(messages.getId(), convoId); channel.setImportantConversation(true); mHelper.createNotificationChannel(PKG_O, UID_O, channel, true, false); mHelper.createNotificationChannel(PKG_O, UID_O, channel, false, false); NotificationChannel diffConvo = new NotificationChannel("B person msgs", "messages from B", IMPORTANCE_DEFAULT); diffConvo.setConversationId(p.getId(), "different convo"); diffConvo.setImportantConversation(true); mHelper.createNotificationChannel(PKG_P, UID_P, diffConvo, true, false); mHelper.createNotificationChannel(PKG_P, UID_P, diffConvo, false, false); NotificationChannel channel2 = new NotificationChannel("A person calls", "calls from A", IMPORTANCE_DEFAULT); Loading @@ -4534,7 +4536,7 @@ public class PreferencesHelperTest extends UiServiceTestCase { new NotificationChannel("A person msgs", "messages from A", IMPORTANCE_DEFAULT); channel.setConversationId(messages.getId(), convoId); channel.setImportantConversation(true); mHelper.createNotificationChannel(PKG_O, UID_O, channel, true, false); mHelper.createNotificationChannel(PKG_O, UID_O, channel, false, false); mHelper.permanentlyDeleteNotificationChannel(PKG_O, UID_O, "messages"); Loading Loading @@ -4935,7 +4937,7 @@ public class PreferencesHelperTest extends UiServiceTestCase { "conversation", IMPORTANCE_DEFAULT); friend.setConversationId(parent.getId(), "friend"); friend.setImportantConversation(true); mHelper.createNotificationChannel(PKG_O, UID_O, friend, true, false); mHelper.createNotificationChannel(PKG_O, UID_O, friend, false, false); ArrayList<StatsEvent> events = new ArrayList<>(); mHelper.pullPackageChannelPreferencesStats(events); Loading