use of android.app.NotificationChannelGroup in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class NotificationPreferenceControllerTest method testOnResume.
@Test
public void testOnResume() {
NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
NotificationChannel channel = mock(NotificationChannel.class);
NotificationChannelGroup group = mock(NotificationChannelGroup.class);
RestrictedLockUtils.EnforcedAdmin admin = mock(RestrictedLockUtils.EnforcedAdmin.class);
mController.onResume(appRow, channel, group, admin);
assertEquals(appRow, mController.mAppRow);
assertEquals(channel, mController.mChannel);
assertEquals(group, mController.mChannelGroup);
assertEquals(admin, mController.mAdmin);
}
use of android.app.NotificationChannelGroup in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class NotificationPreferenceControllerTest method testIsChannelGroupBlockable_nonSystemBlockable.
@Test
public void testIsChannelGroupBlockable_nonSystemBlockable() {
NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
appRow.systemApp = false;
NotificationChannelGroup group = mock(NotificationChannelGroup.class);
when(group.isBlocked()).thenReturn(false);
mController.onResume(appRow, null, group, null);
assertTrue(mController.isChannelGroupBlockable());
}
use of android.app.NotificationChannelGroup in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class DescriptionPreferenceControllerTest method testIsAvailable_notIfChannelGroupBlocked.
@Test
public void testIsAvailable_notIfChannelGroupBlocked() {
NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
NotificationChannelGroup group = mock(NotificationChannelGroup.class);
mController.onResume(appRow, null, group, null);
assertFalse(mController.isAvailable());
}
use of android.app.NotificationChannelGroup in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class HeaderPreferenceControllerTest method testGetLabel.
@Test
public void testGetLabel() {
NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
appRow.label = "bananas";
mController.onResume(appRow, null, null, null);
assertEquals(appRow.label, mController.getLabel());
NotificationChannelGroup group = new NotificationChannelGroup("id", "name");
mController.onResume(appRow, null, group, null);
assertEquals(group.getName(), mController.getLabel());
NotificationChannel channel = new NotificationChannel("cid", "cname", IMPORTANCE_NONE);
mController.onResume(appRow, channel, group, null);
assertEquals(channel.getName(), mController.getLabel());
NotificationChannel defaultChannel = new NotificationChannel(NotificationChannel.DEFAULT_CHANNEL_ID, "", IMPORTANCE_NONE);
mController.onResume(appRow, defaultChannel, null, null);
assertEquals(appRow.label, mController.getLabel());
}
use of android.app.NotificationChannelGroup in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class ImportancePreferenceControllerTest method testIsAvailable_isGroupBlocked.
@Test
public void testIsAvailable_isGroupBlocked() {
NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
NotificationChannel channel = mock(NotificationChannel.class);
when(channel.getImportance()).thenReturn(IMPORTANCE_DEFAULT);
NotificationChannelGroup group = mock(NotificationChannelGroup.class);
when(group.isBlocked()).thenReturn(true);
mController.onResume(appRow, channel, group, null);
assertFalse(mController.isAvailable());
}
Aggregations