Loading services/core/java/com/android/server/notification/PreferencesHelper.java +9 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,11 @@ package com.android.server.notification; import static android.app.AppOpsManager.OP_SYSTEM_ALERT_WINDOW; import static android.app.NotificationChannel.NEWS_ID; import static android.app.NotificationChannel.PLACEHOLDER_CONVERSATION_ID; import static android.app.NotificationChannel.PROMOTIONS_ID; import static android.app.NotificationChannel.RECS_ID; import static android.app.NotificationChannel.SOCIAL_MEDIA_ID; import static android.app.NotificationChannel.USER_LOCKED_IMPORTANCE; import static android.app.NotificationManager.BUBBLE_PREFERENCE_ALL; import static android.app.NotificationManager.BUBBLE_PREFERENCE_NONE; Loading Loading @@ -1581,7 +1585,11 @@ public class PreferencesHelper implements RankingConfig { boolean includeChannel = (includeDeleted || !nc.isDeleted()) && (activeChannelFilter == null || (includeBlocked && nc.getImportance() == IMPORTANCE_NONE) || activeChannelFilter.contains(nc.getId())); || activeChannelFilter.contains(nc.getId())) && !PROMOTIONS_ID.equals(nc.getId()) && !NEWS_ID.equals(nc.getId()) && !SOCIAL_MEDIA_ID.equals(nc.getId()) && !RECS_ID.equals(nc.getId()); if (includeChannel) { if (nc.getGroup() != null) { if (r.groups.get(nc.getGroup()) != null) { Loading services/tests/uiservicestests/src/com/android/server/notification/PreferencesHelperTest.java +4 −3 Original line number Diff line number Diff line Loading @@ -120,6 +120,7 @@ import android.os.RemoteException; import android.os.UserHandle; import android.os.UserManager; import android.permission.PermissionManager; import android.platform.test.annotations.DisableFlags; import android.platform.test.annotations.EnableFlags; import android.platform.test.flag.junit.FlagsParameterization; import android.platform.test.flag.junit.SetFlagsRule; Loading Loading @@ -2127,6 +2128,7 @@ public class PreferencesHelperTest extends UiServiceTestCase { } @Test @DisableFlags(FLAG_NOTIFICATION_CLASSIFICATION) public void testUpdate_preUpgrade_updatesAppFields() throws Exception { assertTrue(mHelper.canShowBadge(PKG_N_MR1, UID_N_MR1)); assertEquals(Notification.PRIORITY_DEFAULT, mHelper.getPackagePriority(PKG_N_MR1, UID_N_MR1)); Loading Loading @@ -2907,6 +2909,7 @@ public class PreferencesHelperTest extends UiServiceTestCase { } @Test @DisableFlags(FLAG_NOTIFICATION_CLASSIFICATION) public void testOnlyHasDefaultChannel() throws Exception { assertTrue(mHelper.onlyHasDefaultChannel(PKG_N_MR1, UID_N_MR1)); assertFalse(mHelper.onlyHasDefaultChannel(PKG_O, UID_O)); Loading Loading @@ -3317,9 +3320,7 @@ public class PreferencesHelperTest extends UiServiceTestCase { assertEquals(3, actual.size()); for (NotificationChannelGroup group : actual) { if (group.getId() == null) { assertEquals( notificationClassification() ? 6 : 2, group.getChannels().size()); // misc channel too assertEquals(2, group.getChannels().size()); assertTrue(channel3.getId().equals(group.getChannels().get(0).getId()) || channel3.getId().equals(group.getChannels().get(1).getId())); } else if (group.getId().equals(ncg.getId())) { Loading Loading
services/core/java/com/android/server/notification/PreferencesHelper.java +9 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,11 @@ package com.android.server.notification; import static android.app.AppOpsManager.OP_SYSTEM_ALERT_WINDOW; import static android.app.NotificationChannel.NEWS_ID; import static android.app.NotificationChannel.PLACEHOLDER_CONVERSATION_ID; import static android.app.NotificationChannel.PROMOTIONS_ID; import static android.app.NotificationChannel.RECS_ID; import static android.app.NotificationChannel.SOCIAL_MEDIA_ID; import static android.app.NotificationChannel.USER_LOCKED_IMPORTANCE; import static android.app.NotificationManager.BUBBLE_PREFERENCE_ALL; import static android.app.NotificationManager.BUBBLE_PREFERENCE_NONE; Loading Loading @@ -1581,7 +1585,11 @@ public class PreferencesHelper implements RankingConfig { boolean includeChannel = (includeDeleted || !nc.isDeleted()) && (activeChannelFilter == null || (includeBlocked && nc.getImportance() == IMPORTANCE_NONE) || activeChannelFilter.contains(nc.getId())); || activeChannelFilter.contains(nc.getId())) && !PROMOTIONS_ID.equals(nc.getId()) && !NEWS_ID.equals(nc.getId()) && !SOCIAL_MEDIA_ID.equals(nc.getId()) && !RECS_ID.equals(nc.getId()); if (includeChannel) { if (nc.getGroup() != null) { if (r.groups.get(nc.getGroup()) != null) { Loading
services/tests/uiservicestests/src/com/android/server/notification/PreferencesHelperTest.java +4 −3 Original line number Diff line number Diff line Loading @@ -120,6 +120,7 @@ import android.os.RemoteException; import android.os.UserHandle; import android.os.UserManager; import android.permission.PermissionManager; import android.platform.test.annotations.DisableFlags; import android.platform.test.annotations.EnableFlags; import android.platform.test.flag.junit.FlagsParameterization; import android.platform.test.flag.junit.SetFlagsRule; Loading Loading @@ -2127,6 +2128,7 @@ public class PreferencesHelperTest extends UiServiceTestCase { } @Test @DisableFlags(FLAG_NOTIFICATION_CLASSIFICATION) public void testUpdate_preUpgrade_updatesAppFields() throws Exception { assertTrue(mHelper.canShowBadge(PKG_N_MR1, UID_N_MR1)); assertEquals(Notification.PRIORITY_DEFAULT, mHelper.getPackagePriority(PKG_N_MR1, UID_N_MR1)); Loading Loading @@ -2907,6 +2909,7 @@ public class PreferencesHelperTest extends UiServiceTestCase { } @Test @DisableFlags(FLAG_NOTIFICATION_CLASSIFICATION) public void testOnlyHasDefaultChannel() throws Exception { assertTrue(mHelper.onlyHasDefaultChannel(PKG_N_MR1, UID_N_MR1)); assertFalse(mHelper.onlyHasDefaultChannel(PKG_O, UID_O)); Loading Loading @@ -3317,9 +3320,7 @@ public class PreferencesHelperTest extends UiServiceTestCase { assertEquals(3, actual.size()); for (NotificationChannelGroup group : actual) { if (group.getId() == null) { assertEquals( notificationClassification() ? 6 : 2, group.getChannels().size()); // misc channel too assertEquals(2, group.getChannels().size()); assertTrue(channel3.getId().equals(group.getChannels().get(0).getId()) || channel3.getId().equals(group.getChannels().get(1).getId())); } else if (group.getId().equals(ncg.getId())) { Loading