Non-blockable whitelist should only control importance fields

Sounds, etc. should still be modifiable

Test: robotests
Fixes: 130086523
Change-Id: I1a95a73b299bb3afd169b249a3dabae3583a448a
This commit is contained in:
Julia Reynolds
2019-04-18 14:45:14 -04:00
parent 5c097c6d3c
commit 73c647513b
12 changed files with 20 additions and 21 deletions

View File

@@ -83,7 +83,6 @@ public class NotificationPreferenceControllerTest {
mController.updateState(mock(Preference.class));
assertFalse(mController.checkCanBeVisible(IMPORTANCE_UNSPECIFIED));
mController.saveChannel();
assertFalse(mController.isChannelConfigurable());
assertFalse(mController.isChannelBlockable());
assertFalse(mController.isChannelGroupBlockable());
}
@@ -204,7 +203,7 @@ public class NotificationPreferenceControllerTest {
}
@Test
public void testIsConfigurable() {
public void testIsBlockable_channelLevelWhitelist() {
String sameId = "bananas";
NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
appRow.lockedChannelId = sameId;
@@ -212,25 +211,25 @@ public class NotificationPreferenceControllerTest {
when(channel.getId()).thenReturn(sameId);
mController.onResume(appRow, channel, null, null);
assertFalse(mController.isChannelConfigurable());
assertFalse(mController.isChannelBlockable());
when(channel.getId()).thenReturn("something new");
mController.onResume(appRow, channel, null, null);
assertTrue(mController.isChannelConfigurable());
assertTrue(mController.isChannelBlockable());
}
@Test
public void testIsConfigurable_appLevel() {
public void testIsBlockable_appLevelWhitelist() {
NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
appRow.lockedChannelId = "something";
appRow.lockedImportance = true;
mController.onResume(appRow, mock(NotificationChannel.class), null, null);
assertFalse(mController.isChannelConfigurable());
assertFalse(mController.isChannelBlockable());
appRow.lockedImportance = false;
mController.onResume(appRow, mock(NotificationChannel.class), null, null);
assertTrue(mController.isChannelConfigurable());
assertTrue(mController.isChannelBlockable());
}
@Test