use of android.app.NotificationChannelGroup in project android_packages_apps_Settings by omnirom.
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, null, null, null);
assertTrue(mController.isAvailable());
}
use of android.app.NotificationChannelGroup in project android_packages_apps_Settings by omnirom.
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, null, null, admin, null);
assertEquals(appRow, mController.mAppRow);
assertEquals(channel, mController.mChannel);
assertEquals(group, mController.mChannelGroup);
assertEquals(admin, mController.mAdmin);
}
use of android.app.NotificationChannelGroup in project android_packages_apps_Settings by omnirom.
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, null, null, null);
when(group.isBlocked()).thenReturn(true);
assertFalse(mController.isAvailable());
}
use of android.app.NotificationChannelGroup in project android_packages_apps_Settings by omnirom.
the class NotificationPreferenceControllerTest method isAvailable.
@Test
public void isAvailable() {
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(false);
mController.onResume(appRow, channel, group, null, null, null, null);
assertTrue(mController.isAvailable());
}
use of android.app.NotificationChannelGroup in project android_packages_apps_Settings by omnirom.
the class NotificationPreferenceControllerTest method testIsChannelGroupBlockable_canUndoSystemBlock.
@Test
public void testIsChannelGroupBlockable_canUndoSystemBlock() {
NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
appRow.systemApp = true;
NotificationChannelGroup group = mock(NotificationChannelGroup.class);
when(group.isBlocked()).thenReturn(true);
mController.onResume(appRow, null, group, null, null, null, null);
assertTrue(mController.isChannelGroupBlockable());
}
Aggregations