diff --git a/tests/robotests/src/com/android/settings/notification/AllowSoundPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/AllowSoundPreferenceControllerTest.java index 88f8303b179..9d2754139fe 100644 --- a/tests/robotests/src/com/android/settings/notification/AllowSoundPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/notification/AllowSoundPreferenceControllerTest.java @@ -139,7 +139,7 @@ public class AllowSoundPreferenceControllerTest { } @Test - public void testUpdateState_notConfigurable() { + public void testUpdateState_notBlockable() { String lockedId = "locked"; NotificationBackend.AppRow appRow = new NotificationBackend.AppRow(); appRow.lockedChannelId = lockedId; @@ -150,7 +150,7 @@ public class AllowSoundPreferenceControllerTest { Preference pref = new RestrictedSwitchPreference(mContext); mController.updateState(pref); - assertFalse(pref.isEnabled()); + assertTrue(pref.isEnabled()); } @Test diff --git a/tests/robotests/src/com/android/settings/notification/BadgePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/BadgePreferenceControllerTest.java index 8265295a76b..9ea201a531f 100644 --- a/tests/robotests/src/com/android/settings/notification/BadgePreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/notification/BadgePreferenceControllerTest.java @@ -187,7 +187,7 @@ public class BadgePreferenceControllerTest { } @Test - public void testUpdateState_channelNotConfigurable() { + public void testUpdateState_channelNotBlockable() { String lockedId = "locked"; NotificationBackend.AppRow appRow = new NotificationBackend.AppRow(); appRow.lockedChannelId = lockedId; @@ -198,7 +198,7 @@ public class BadgePreferenceControllerTest { Preference pref = new RestrictedSwitchPreference(mContext); mController.updateState(pref); - assertFalse(pref.isEnabled()); + assertTrue(pref.isEnabled()); } @Test diff --git a/tests/robotests/src/com/android/settings/notification/BubblePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/BubblePreferenceControllerTest.java index 54bbd0874c7..0d0b4852b58 100644 --- a/tests/robotests/src/com/android/settings/notification/BubblePreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/notification/BubblePreferenceControllerTest.java @@ -202,7 +202,7 @@ public class BubblePreferenceControllerTest { } @Test - public void testUpdateState_channelNotConfigurable() { + public void testUpdateState_channelNotBlockable() { String lockedId = "locked"; NotificationBackend.AppRow appRow = new NotificationBackend.AppRow(); appRow.lockedChannelId = lockedId; @@ -213,7 +213,7 @@ public class BubblePreferenceControllerTest { Preference pref = new RestrictedSwitchPreference(mContext); mController.updateState(pref); - assertFalse(pref.isEnabled()); + assertTrue(pref.isEnabled()); } @Test diff --git a/tests/robotests/src/com/android/settings/notification/DndPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/DndPreferenceControllerTest.java index 0b2af49e830..929c14d7db3 100644 --- a/tests/robotests/src/com/android/settings/notification/DndPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/notification/DndPreferenceControllerTest.java @@ -110,7 +110,7 @@ public class DndPreferenceControllerTest { } @Test - public void testUpdateState_notConfigurable() { + public void testUpdateState_notBlockable() { String lockedId = "locked"; NotificationBackend.AppRow appRow = new NotificationBackend.AppRow(); appRow.lockedChannelId = lockedId; @@ -121,7 +121,7 @@ public class DndPreferenceControllerTest { Preference pref = new RestrictedSwitchPreference(RuntimeEnvironment.application); mController.updateState(pref); - assertFalse(pref.isEnabled()); + assertTrue(pref.isEnabled()); } @Test diff --git a/tests/robotests/src/com/android/settings/notification/LightsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/LightsPreferenceControllerTest.java index dd6a6208381..3724ddb9c43 100644 --- a/tests/robotests/src/com/android/settings/notification/LightsPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/notification/LightsPreferenceControllerTest.java @@ -158,7 +158,7 @@ public class LightsPreferenceControllerTest { } @Test - public void testUpdateState_notConfigurable() { + public void testUpdateState_notBlockable() { String lockedId = "locked"; NotificationBackend.AppRow appRow = new NotificationBackend.AppRow(); appRow.lockedChannelId = lockedId; @@ -169,19 +169,6 @@ public class LightsPreferenceControllerTest { Preference pref = new RestrictedSwitchPreference(mContext); mController.updateState(pref); - assertFalse(pref.isEnabled()); - } - - @Test - public void testUpdateState_configurable() { - NotificationBackend.AppRow appRow = new NotificationBackend.AppRow(); - NotificationChannel channel = mock(NotificationChannel.class); - when(channel.getId()).thenReturn("something"); - mController.onResume(appRow, channel, null, null); - - Preference pref = new RestrictedSwitchPreference(mContext); - mController.updateState(pref); - assertTrue(pref.isEnabled()); } diff --git a/tests/robotests/src/com/android/settings/notification/NotificationPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/NotificationPreferenceControllerTest.java index 8c743348875..a72597b4ba7 100644 --- a/tests/robotests/src/com/android/settings/notification/NotificationPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/notification/NotificationPreferenceControllerTest.java @@ -209,6 +209,7 @@ public class NotificationPreferenceControllerTest { appRow.lockedChannelId = sameId; NotificationChannel channel = mock(NotificationChannel.class); when(channel.getId()).thenReturn(sameId); + when(channel.getImportance()).thenReturn(IMPORTANCE_LOW); mController.onResume(appRow, channel, null, null); assertFalse(mController.isChannelBlockable()); @@ -223,8 +224,10 @@ public class NotificationPreferenceControllerTest { NotificationBackend.AppRow appRow = new NotificationBackend.AppRow(); appRow.lockedChannelId = "something"; appRow.lockedImportance = true; + NotificationChannel channel = mock(NotificationChannel.class); + when(channel.getImportance()).thenReturn(IMPORTANCE_LOW); - mController.onResume(appRow, mock(NotificationChannel.class), null, null); + mController.onResume(appRow, channel, null, null); assertFalse(mController.isChannelBlockable()); appRow.lockedImportance = false; diff --git a/tests/robotests/src/com/android/settings/notification/SoundPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/SoundPreferenceControllerTest.java index 866f8668a21..1d9836e2af1 100644 --- a/tests/robotests/src/com/android/settings/notification/SoundPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/notification/SoundPreferenceControllerTest.java @@ -161,7 +161,7 @@ public class SoundPreferenceControllerTest { } @Test - public void testUpdateState_notConfigurable() { + public void testUpdateState_notBlockable() { String lockedId = "locked"; NotificationBackend.AppRow appRow = new NotificationBackend.AppRow(); appRow.lockedChannelId = lockedId; @@ -173,7 +173,7 @@ public class SoundPreferenceControllerTest { Preference pref = new NotificationSoundPreference(mContext, attributeSet); mController.updateState(pref); - assertFalse(pref.isEnabled()); + assertTrue(pref.isEnabled()); } @Test diff --git a/tests/robotests/src/com/android/settings/notification/VibrationPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/VibrationPreferenceControllerTest.java index e1d5b73574c..adc10f46180 100644 --- a/tests/robotests/src/com/android/settings/notification/VibrationPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/notification/VibrationPreferenceControllerTest.java @@ -140,7 +140,7 @@ public class VibrationPreferenceControllerTest { } @Test - public void testUpdateState_notConfigurable() { + public void testUpdateState_notBlockable() { String lockedId = "locked"; NotificationBackend.AppRow appRow = new NotificationBackend.AppRow(); appRow.lockedChannelId = lockedId; @@ -151,7 +151,7 @@ public class VibrationPreferenceControllerTest { Preference pref = new RestrictedSwitchPreference(RuntimeEnvironment.application); mController.updateState(pref); - assertFalse(pref.isEnabled()); + assertTrue(pref.isEnabled()); } @Test