Loading src/com/android/settings/homepage/contextualcards/slices/NotificationChannelSlice.java +1 −1 Original line number Diff line number Diff line Loading @@ -467,7 +467,7 @@ public class NotificationChannelSlice implements CustomSliceable { return true; } return channel.isBlockableSystem() return channel.isBlockable() || channel.getImportance() == IMPORTANCE_NONE; } Loading src/com/android/settings/notification/app/NotificationPreferenceController.java +1 −1 Original line number Diff line number Diff line Loading @@ -134,7 +134,7 @@ public abstract class NotificationPreferenceController extends AbstractPreferenc return channel.getImportance() == IMPORTANCE_NONE; } return channel.isBlockableSystem() || !mAppRow.systemApp return channel.isBlockable() || !mAppRow.systemApp || channel.getImportance() == IMPORTANCE_NONE; } return false; Loading tests/robotests/src/com/android/settings/notification/app/BlockPreferenceControllerTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -200,7 +200,7 @@ public class BlockPreferenceControllerTest { NotificationBackend.AppRow appRow = new NotificationBackend.AppRow(); appRow.systemApp = true; NotificationChannel channel = new NotificationChannel("", "", IMPORTANCE_DEFAULT); channel.setBlockableSystem(true); channel.setBlockable(true); mController.onResume(appRow, channel, null, null, null, null); mController.updateState(mPreference); assertTrue(mSwitch.isEnabled()); Loading tests/robotests/src/com/android/settings/notification/app/NotificationPreferenceControllerTest.java +4 −4 Original line number Diff line number Diff line Loading @@ -236,7 +236,7 @@ public class NotificationPreferenceControllerTest { NotificationBackend.AppRow appRow = new NotificationBackend.AppRow(); appRow.systemApp = false; NotificationChannel channel = mock(NotificationChannel.class); when(channel.isBlockableSystem()).thenReturn(false); when(channel.isBlockable()).thenReturn(false); mController.onResume(appRow, channel, null, null, null, null); assertTrue(mController.isChannelBlockable()); Loading @@ -247,7 +247,7 @@ public class NotificationPreferenceControllerTest { NotificationBackend.AppRow appRow = new NotificationBackend.AppRow(); appRow.systemApp = true; NotificationChannel channel = mock(NotificationChannel.class); when(channel.isBlockableSystem()).thenReturn(false); when(channel.isBlockable()).thenReturn(false); when(channel.getImportance()).thenReturn(IMPORTANCE_HIGH); mController.onResume(appRow, channel, null, null, null, null); Loading @@ -259,7 +259,7 @@ public class NotificationPreferenceControllerTest { NotificationBackend.AppRow appRow = new NotificationBackend.AppRow(); appRow.systemApp = true; NotificationChannel channel = mock(NotificationChannel.class); when(channel.isBlockableSystem()).thenReturn(true); when(channel.isBlockable()).thenReturn(true); mController.onResume(appRow, channel, null, null, null, null); assertTrue(mController.isChannelBlockable()); Loading @@ -270,7 +270,7 @@ public class NotificationPreferenceControllerTest { NotificationBackend.AppRow appRow = new NotificationBackend.AppRow(); appRow.systemApp = true; NotificationChannel channel = mock(NotificationChannel.class); when(channel.isBlockableSystem()).thenReturn(false); when(channel.isBlockable()).thenReturn(false); when(channel.getImportance()).thenReturn(IMPORTANCE_NONE); mController.onResume(appRow, channel, null, null, null, null); Loading Loading
src/com/android/settings/homepage/contextualcards/slices/NotificationChannelSlice.java +1 −1 Original line number Diff line number Diff line Loading @@ -467,7 +467,7 @@ public class NotificationChannelSlice implements CustomSliceable { return true; } return channel.isBlockableSystem() return channel.isBlockable() || channel.getImportance() == IMPORTANCE_NONE; } Loading
src/com/android/settings/notification/app/NotificationPreferenceController.java +1 −1 Original line number Diff line number Diff line Loading @@ -134,7 +134,7 @@ public abstract class NotificationPreferenceController extends AbstractPreferenc return channel.getImportance() == IMPORTANCE_NONE; } return channel.isBlockableSystem() || !mAppRow.systemApp return channel.isBlockable() || !mAppRow.systemApp || channel.getImportance() == IMPORTANCE_NONE; } return false; Loading
tests/robotests/src/com/android/settings/notification/app/BlockPreferenceControllerTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -200,7 +200,7 @@ public class BlockPreferenceControllerTest { NotificationBackend.AppRow appRow = new NotificationBackend.AppRow(); appRow.systemApp = true; NotificationChannel channel = new NotificationChannel("", "", IMPORTANCE_DEFAULT); channel.setBlockableSystem(true); channel.setBlockable(true); mController.onResume(appRow, channel, null, null, null, null); mController.updateState(mPreference); assertTrue(mSwitch.isEnabled()); Loading
tests/robotests/src/com/android/settings/notification/app/NotificationPreferenceControllerTest.java +4 −4 Original line number Diff line number Diff line Loading @@ -236,7 +236,7 @@ public class NotificationPreferenceControllerTest { NotificationBackend.AppRow appRow = new NotificationBackend.AppRow(); appRow.systemApp = false; NotificationChannel channel = mock(NotificationChannel.class); when(channel.isBlockableSystem()).thenReturn(false); when(channel.isBlockable()).thenReturn(false); mController.onResume(appRow, channel, null, null, null, null); assertTrue(mController.isChannelBlockable()); Loading @@ -247,7 +247,7 @@ public class NotificationPreferenceControllerTest { NotificationBackend.AppRow appRow = new NotificationBackend.AppRow(); appRow.systemApp = true; NotificationChannel channel = mock(NotificationChannel.class); when(channel.isBlockableSystem()).thenReturn(false); when(channel.isBlockable()).thenReturn(false); when(channel.getImportance()).thenReturn(IMPORTANCE_HIGH); mController.onResume(appRow, channel, null, null, null, null); Loading @@ -259,7 +259,7 @@ public class NotificationPreferenceControllerTest { NotificationBackend.AppRow appRow = new NotificationBackend.AppRow(); appRow.systemApp = true; NotificationChannel channel = mock(NotificationChannel.class); when(channel.isBlockableSystem()).thenReturn(true); when(channel.isBlockable()).thenReturn(true); mController.onResume(appRow, channel, null, null, null, null); assertTrue(mController.isChannelBlockable()); Loading @@ -270,7 +270,7 @@ public class NotificationPreferenceControllerTest { NotificationBackend.AppRow appRow = new NotificationBackend.AppRow(); appRow.systemApp = true; NotificationChannel channel = mock(NotificationChannel.class); when(channel.isBlockableSystem()).thenReturn(false); when(channel.isBlockable()).thenReturn(false); when(channel.getImportance()).thenReturn(IMPORTANCE_NONE); mController.onResume(appRow, channel, null, null, null, null); Loading