use of android.app.NotificationChannelGroup in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class NotificationPreferenceControllerTest method isAvailable_notIfChannelGroupBlocked.
@Test
public void isAvailable_notIfChannelGroupBlocked() {
NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
NotificationChannel channel = mock(NotificationChannel.class);
when(channel.getImportance()).thenReturn(IMPORTANCE_DEFAULT);
NotificationChannelGroup group = mock(NotificationChannelGroup.class);
mController.onResume(appRow, channel, group, null);
when(group.isBlocked()).thenReturn(true);
assertFalse(mController.isAvailable());
}
use of android.app.NotificationChannelGroup in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class AppNotificationSettingsTest method setUp.
@Before
public void setUp() throws Exception {
mInstrumentation = InstrumentationRegistry.getInstrumentation();
mTargetContext = mInstrumentation.getTargetContext();
mUiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation());
mUiDevice.wakeUp();
mUiDevice.executeShellCommand(WM_DISMISS_KEYGUARD_COMMAND);
mNm = (NotificationManager) mTargetContext.getSystemService(Context.NOTIFICATION_SERVICE);
mGroup1 = new NotificationChannelGroup(this.getClass().getName() + "1", "group1");
mGroup2 = new NotificationChannelGroup(this.getClass().getName() + "2", "group2");
mNm.createNotificationChannelGroup(mGroup1);
mNm.createNotificationChannelGroup(mGroup2);
mGroup1Channel1 = createChannel(mGroup1, this.getClass().getName() + "c1-1");
mGroup1Channel2 = createChannel(mGroup1, this.getClass().getName() + "c1-2");
mGroup2Channel1 = createChannel(mGroup2, this.getClass().getName() + "c2-1");
mUngroupedChannel = createChannel(null, this.getClass().getName() + "c");
}
use of android.app.NotificationChannelGroup in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class NotificationChannelSliceTest method buildNotificationChannelGroups.
private ParceledListSlice<NotificationChannelGroup> buildNotificationChannelGroups(List<NotificationChannel> channels) {
final NotificationChannelGroup notificationChannelGroup = new NotificationChannelGroup("group", "group");
notificationChannelGroup.setBlocked(false);
notificationChannelGroup.setChannels(channels);
return new ParceledListSlice(Arrays.asList(notificationChannelGroup));
}
use of android.app.NotificationChannelGroup in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class DescriptionPreferenceControllerTest method testUpdateState_channelGroup.
@Test
public void testUpdateState_channelGroup() {
NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
NotificationChannelGroup group = mock(NotificationChannelGroup.class);
when(group.getDescription()).thenReturn("something");
mController.onResume(appRow, null, group, null);
Preference pref = new Preference(RuntimeEnvironment.application);
mController.updateState(pref);
assertEquals("something", pref.getTitle());
assertFalse(pref.isEnabled());
assertFalse(pref.isSelectable());
}
use of android.app.NotificationChannelGroup in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class DescriptionPreferenceControllerTest method testIsAvailable_channelGroup.
@Test
public void testIsAvailable_channelGroup() {
NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
NotificationChannelGroup group = mock(NotificationChannelGroup.class);
when(group.getDescription()).thenReturn("something");
when(group.isBlocked()).thenReturn(false);
mController.onResume(appRow, null, group, null);
assertTrue(mController.isAvailable());
}
Aggregations