Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 64e48c20 authored by Hall Liu's avatar Hall Liu Committed by Android (Google) Code Review
Browse files

Merge "Rename NotificationChannel#setBlockableSystem" into rvc-dev

parents 6c95bb5c 45e4b894
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -467,7 +467,7 @@ public class NotificationChannelSlice implements CustomSliceable {
                return true;
            }

            return channel.isBlockableSystem()
            return channel.isBlockable()
                    || channel.getImportance() == IMPORTANCE_NONE;
        }

+1 −1
Original line number Diff line number Diff line
@@ -134,7 +134,7 @@ public abstract class NotificationPreferenceController extends AbstractPreferenc
                return channel.getImportance() == IMPORTANCE_NONE;
            }

            return channel.isBlockableSystem() || !mAppRow.systemApp
            return channel.isBlockable() || !mAppRow.systemApp
                    || channel.getImportance() == IMPORTANCE_NONE;
        }
        return false;
+1 −1
Original line number Diff line number Diff line
@@ -200,7 +200,7 @@ public class BlockPreferenceControllerTest {
        NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
        appRow.systemApp = true;
        NotificationChannel channel = new NotificationChannel("", "", IMPORTANCE_DEFAULT);
        channel.setBlockableSystem(true);
        channel.setBlockable(true);
        mController.onResume(appRow, channel, null, null, null, null);
        mController.updateState(mPreference);
        assertTrue(mSwitch.isEnabled());
+4 −4
Original line number Diff line number Diff line
@@ -236,7 +236,7 @@ public class NotificationPreferenceControllerTest {
        NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
        appRow.systemApp = false;
        NotificationChannel channel = mock(NotificationChannel.class);
        when(channel.isBlockableSystem()).thenReturn(false);
        when(channel.isBlockable()).thenReturn(false);

        mController.onResume(appRow, channel, null, null, null, null);
        assertTrue(mController.isChannelBlockable());
@@ -247,7 +247,7 @@ public class NotificationPreferenceControllerTest {
        NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
        appRow.systemApp = true;
        NotificationChannel channel = mock(NotificationChannel.class);
        when(channel.isBlockableSystem()).thenReturn(false);
        when(channel.isBlockable()).thenReturn(false);
        when(channel.getImportance()).thenReturn(IMPORTANCE_HIGH);

        mController.onResume(appRow, channel, null, null, null, null);
@@ -259,7 +259,7 @@ public class NotificationPreferenceControllerTest {
        NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
        appRow.systemApp = true;
        NotificationChannel channel = mock(NotificationChannel.class);
        when(channel.isBlockableSystem()).thenReturn(true);
        when(channel.isBlockable()).thenReturn(true);

        mController.onResume(appRow, channel, null, null, null, null);
        assertTrue(mController.isChannelBlockable());
@@ -270,7 +270,7 @@ public class NotificationPreferenceControllerTest {
        NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
        appRow.systemApp = true;
        NotificationChannel channel = mock(NotificationChannel.class);
        when(channel.isBlockableSystem()).thenReturn(false);
        when(channel.isBlockable()).thenReturn(false);
        when(channel.getImportance()).thenReturn(IMPORTANCE_NONE);

        mController.onResume(appRow, channel, null, null, null, null);