Restore group block button.

Test: RunSettingsRoboTests
Bug: 63927402
Change-Id: I2e8163082d81d696dce2082be49a16c85458672b
This commit is contained in:
Julia Reynolds
2017-11-17 15:04:40 -05:00
parent 4559ddeb09
commit a87cee11b6
2 changed files with 4 additions and 1 deletions

View File

@@ -172,7 +172,7 @@ public abstract class NotificationPreferenceController extends AbstractPreferenc
} }
protected boolean isChannelGroupBlockable() { protected boolean isChannelGroupBlockable() {
if (mChannelGroup != null && mChannelGroup.getGroup() == null && mAppRow != null) { if (mChannelGroup != null && mChannelGroup.getGroup() != null && mAppRow != null) {
if (!mAppRow.systemApp) { if (!mAppRow.systemApp) {
return true; return true;
} }

View File

@@ -273,6 +273,7 @@ public class NotificationPreferenceControllerTest {
NotificationBackend.AppRow appRow = new NotificationBackend.AppRow(); NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
appRow.systemApp = false; appRow.systemApp = false;
NotificationChannelGroupWrapper group = mock(NotificationChannelGroupWrapper.class); NotificationChannelGroupWrapper group = mock(NotificationChannelGroupWrapper.class);
when(group.getGroup()).thenReturn(mock(NotificationChannelGroup.class));
when(group.isBlocked()).thenReturn(false); when(group.isBlocked()).thenReturn(false);
mController.onResume(appRow, null, group, null); mController.onResume(appRow, null, group, null);
@@ -284,6 +285,7 @@ public class NotificationPreferenceControllerTest {
NotificationBackend.AppRow appRow = new NotificationBackend.AppRow(); NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
appRow.systemApp = true; appRow.systemApp = true;
NotificationChannelGroupWrapper group = mock(NotificationChannelGroupWrapper.class); NotificationChannelGroupWrapper group = mock(NotificationChannelGroupWrapper.class);
when(group.getGroup()).thenReturn(mock(NotificationChannelGroup.class));
when(group.isBlocked()).thenReturn(false); when(group.isBlocked()).thenReturn(false);
mController.onResume(appRow, null, group, null); mController.onResume(appRow, null, group, null);
@@ -295,6 +297,7 @@ public class NotificationPreferenceControllerTest {
NotificationBackend.AppRow appRow = new NotificationBackend.AppRow(); NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
appRow.systemApp = true; appRow.systemApp = true;
NotificationChannelGroupWrapper group = mock(NotificationChannelGroupWrapper.class); NotificationChannelGroupWrapper group = mock(NotificationChannelGroupWrapper.class);
when(group.getGroup()).thenReturn(mock(NotificationChannelGroup.class));
when(group.isBlocked()).thenReturn(true); when(group.isBlocked()).thenReturn(true);
mController.onResume(appRow, null, group, null); mController.onResume(appRow, null, group, null);