Loading core/java/android/app/INotificationManager.aidl +0 −1 Original line number Diff line number Diff line Loading @@ -114,7 +114,6 @@ interface INotificationManager NotificationChannelGroup getNotificationChannelGroup(String pkg, String channelGroupId); ParceledListSlice getNotificationChannelGroups(String pkg); boolean onlyHasDefaultChannel(String pkg, int uid); int getBlockedAppCount(int userId); boolean areChannelsBypassingDnd(); int getAppsBypassingDndCount(int uid); ParceledListSlice getNotificationChannelsBypassingDnd(String pkg, int userId); Loading services/core/java/com/android/server/notification/NotificationManagerService.java +0 −6 Original line number Diff line number Diff line Loading @@ -4081,12 +4081,6 @@ public class NotificationManagerService extends SystemService { + " cannot read channels for " + targetPkg + " in " + userId); } @Override public int getBlockedAppCount(int userId) { checkCallerIsSystem(); return mPreferencesHelper.getBlockedAppCount(userId); } @Override public int getAppsBypassingDndCount(int userId) { checkCallerIsSystem(); Loading services/core/java/com/android/server/notification/PreferencesHelper.java +0 −15 Original line number Diff line number Diff line Loading @@ -1621,21 +1621,6 @@ public class PreferencesHelper implements RankingConfig { } } public int getBlockedAppCount(int userId) { int count = 0; synchronized (mPackagePreferences) { final int N = mPackagePreferences.size(); for (int i = 0; i < N; i++) { final PackagePreferences r = mPackagePreferences.valueAt(i); if (userId == UserHandle.getUserId(r.uid) && r.importance == IMPORTANCE_NONE) { count++; } } } return count; } /** * Returns the number of apps that have at least one notification channel that can bypass DND * for given particular user Loading services/tests/uiservicestests/src/com/android/server/notification/PreferencesHelperTest.java +0 −20 Original line number Diff line number Diff line Loading @@ -2337,26 +2337,6 @@ public class PreferencesHelperTest extends UiServiceTestCase { assertFalse(mHelper.getNotificationChannel(PKG_N_MR1, 1000, "A", false).canBypassDnd()); } @Test public void testGetBlockedAppCount_noApps() { assertEquals(0, mHelper.getBlockedAppCount(0)); } @Test public void testGetBlockedAppCount_noAppsForUserId() { mHelper.setEnabled(PKG_N_MR1, 100, false); assertEquals(0, mHelper.getBlockedAppCount(9)); } @Test public void testGetBlockedAppCount_appsForUserId() { mHelper.setEnabled(PKG_N_MR1, 1020, false); mHelper.setEnabled(PKG_N_MR1, 1030, false); mHelper.setEnabled(PKG_N_MR1, 1060, false); mHelper.setEnabled(PKG_N_MR1, 1000, true); assertEquals(3, mHelper.getBlockedAppCount(0)); } @Test public void testAppBlockedLogging() { mHelper.setEnabled(PKG_N_MR1, 1020, false); Loading Loading
core/java/android/app/INotificationManager.aidl +0 −1 Original line number Diff line number Diff line Loading @@ -114,7 +114,6 @@ interface INotificationManager NotificationChannelGroup getNotificationChannelGroup(String pkg, String channelGroupId); ParceledListSlice getNotificationChannelGroups(String pkg); boolean onlyHasDefaultChannel(String pkg, int uid); int getBlockedAppCount(int userId); boolean areChannelsBypassingDnd(); int getAppsBypassingDndCount(int uid); ParceledListSlice getNotificationChannelsBypassingDnd(String pkg, int userId); Loading
services/core/java/com/android/server/notification/NotificationManagerService.java +0 −6 Original line number Diff line number Diff line Loading @@ -4081,12 +4081,6 @@ public class NotificationManagerService extends SystemService { + " cannot read channels for " + targetPkg + " in " + userId); } @Override public int getBlockedAppCount(int userId) { checkCallerIsSystem(); return mPreferencesHelper.getBlockedAppCount(userId); } @Override public int getAppsBypassingDndCount(int userId) { checkCallerIsSystem(); Loading
services/core/java/com/android/server/notification/PreferencesHelper.java +0 −15 Original line number Diff line number Diff line Loading @@ -1621,21 +1621,6 @@ public class PreferencesHelper implements RankingConfig { } } public int getBlockedAppCount(int userId) { int count = 0; synchronized (mPackagePreferences) { final int N = mPackagePreferences.size(); for (int i = 0; i < N; i++) { final PackagePreferences r = mPackagePreferences.valueAt(i); if (userId == UserHandle.getUserId(r.uid) && r.importance == IMPORTANCE_NONE) { count++; } } } return count; } /** * Returns the number of apps that have at least one notification channel that can bypass DND * for given particular user Loading
services/tests/uiservicestests/src/com/android/server/notification/PreferencesHelperTest.java +0 −20 Original line number Diff line number Diff line Loading @@ -2337,26 +2337,6 @@ public class PreferencesHelperTest extends UiServiceTestCase { assertFalse(mHelper.getNotificationChannel(PKG_N_MR1, 1000, "A", false).canBypassDnd()); } @Test public void testGetBlockedAppCount_noApps() { assertEquals(0, mHelper.getBlockedAppCount(0)); } @Test public void testGetBlockedAppCount_noAppsForUserId() { mHelper.setEnabled(PKG_N_MR1, 100, false); assertEquals(0, mHelper.getBlockedAppCount(9)); } @Test public void testGetBlockedAppCount_appsForUserId() { mHelper.setEnabled(PKG_N_MR1, 1020, false); mHelper.setEnabled(PKG_N_MR1, 1030, false); mHelper.setEnabled(PKG_N_MR1, 1060, false); mHelper.setEnabled(PKG_N_MR1, 1000, true); assertEquals(3, mHelper.getBlockedAppCount(0)); } @Test public void testAppBlockedLogging() { mHelper.setEnabled(PKG_N_MR1, 1020, false); Loading