Fix hiding of channel fields
When channel is off Test: atest Bug: 132971502 Change-Id: I5772266e022e5ebb5dbf20f231ca30fad95e3db7
This commit is contained in:
@@ -74,7 +74,9 @@ public abstract class NotificationPreferenceController extends AbstractPreferenc
|
||||
return false;
|
||||
}
|
||||
if (mChannelGroup != null) {
|
||||
return !mChannelGroup.isBlocked();
|
||||
if (mChannelGroup.isBlocked()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (mChannel != null) {
|
||||
return mChannel.getImportance() != IMPORTANCE_NONE;
|
||||
|
@@ -105,10 +105,12 @@ public class NotificationPreferenceControllerTest {
|
||||
@Test
|
||||
public void isAvailable_notIfChannelBlocked() {
|
||||
NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
|
||||
NotificationChannelGroup group = mock(NotificationChannelGroup.class);
|
||||
when(group.isBlocked()).thenReturn(false);
|
||||
NotificationChannel channel = mock(NotificationChannel.class);
|
||||
when(channel.getImportance()).thenReturn(IMPORTANCE_NONE);
|
||||
|
||||
mController.onResume(appRow, channel, null, null);
|
||||
mController.onResume(appRow, channel, group, null);
|
||||
assertFalse(mController.isAvailable());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user