Loading src/com/android/settings/notification/NotificationPreferenceController.java +3 −1 Original line number Diff line number Diff line Loading @@ -74,7 +74,9 @@ public abstract class NotificationPreferenceController extends AbstractPreferenc return false; } if (mChannelGroup != null) { return !mChannelGroup.isBlocked(); if (mChannelGroup.isBlocked()) { return false; } } if (mChannel != null) { return mChannel.getImportance() != IMPORTANCE_NONE; Loading tests/robotests/src/com/android/settings/notification/NotificationPreferenceControllerTest.java +3 −1 Original line number Diff line number Diff line Loading @@ -105,10 +105,12 @@ public class NotificationPreferenceControllerTest { @Test public void isAvailable_notIfChannelBlocked() { NotificationBackend.AppRow appRow = new NotificationBackend.AppRow(); NotificationChannelGroup group = mock(NotificationChannelGroup.class); when(group.isBlocked()).thenReturn(false); NotificationChannel channel = mock(NotificationChannel.class); when(channel.getImportance()).thenReturn(IMPORTANCE_NONE); mController.onResume(appRow, channel, null, null); mController.onResume(appRow, channel, group, null); assertFalse(mController.isAvailable()); } Loading Loading
src/com/android/settings/notification/NotificationPreferenceController.java +3 −1 Original line number Diff line number Diff line Loading @@ -74,7 +74,9 @@ public abstract class NotificationPreferenceController extends AbstractPreferenc return false; } if (mChannelGroup != null) { return !mChannelGroup.isBlocked(); if (mChannelGroup.isBlocked()) { return false; } } if (mChannel != null) { return mChannel.getImportance() != IMPORTANCE_NONE; Loading
tests/robotests/src/com/android/settings/notification/NotificationPreferenceControllerTest.java +3 −1 Original line number Diff line number Diff line Loading @@ -105,10 +105,12 @@ public class NotificationPreferenceControllerTest { @Test public void isAvailable_notIfChannelBlocked() { NotificationBackend.AppRow appRow = new NotificationBackend.AppRow(); NotificationChannelGroup group = mock(NotificationChannelGroup.class); when(group.isBlocked()).thenReturn(false); NotificationChannel channel = mock(NotificationChannel.class); when(channel.getImportance()).thenReturn(IMPORTANCE_NONE); mController.onResume(appRow, channel, null, null); mController.onResume(appRow, channel, group, null); assertFalse(mController.isAvailable()); } Loading