Loading tests/unit/src/com/android/settings/network/telephony/CellularSecurityNotificationsPreferenceControllerTest.java +0 −48 Original line number Diff line number Diff line Loading @@ -112,42 +112,6 @@ public class CellularSecurityNotificationsPreferenceControllerTest { assertThat(mController.getAvailabilityStatus()).isEqualTo(UNSUPPORTED_ON_DEVICE); } @Test public void setChecked_flagsDisabled_shouldReturnFalse() { // Flags disabled enableFlags(false); // Hardware support is enabled doNothing().when(mTelephonyManager).setNullCipherNotificationsEnabled(true); doNothing().when(mTelephonyManager) .setEnableCellularIdentifierDisclosureNotifications(true); assertThat(mController.setChecked(false)).isFalse(); assertThat(mController.setChecked(true)).isFalse(); // Enable 1 flag, make sure it still fails mSetFlagsRule.enableFlags(Flags.FLAG_ENABLE_MODEM_CIPHER_TRANSPARENCY_UNSOL_EVENTS); assertThat(mController.setChecked(false)).isFalse(); assertThat(mController.setChecked(true)).isFalse(); } @Test public void setChecked_hardwareDisabled_shouldReturnFalse() { // Flags disabled enableFlags(false); // Hardware support is enabled doNothing().when(mTelephonyManager).setNullCipherNotificationsEnabled(true); doNothing().when(mTelephonyManager) .setEnableCellularIdentifierDisclosureNotifications(true); assertThat(mController.setChecked(true)).isFalse(); // Hardware support is enabled, called with false doNothing().when(mTelephonyManager).setNullCipherNotificationsEnabled(false); doNothing().when(mTelephonyManager) .setEnableCellularIdentifierDisclosureNotifications(false); assertThat(mController.setChecked(false)).isFalse(); } @Test public void setChecked_shouldReturnTrue() { enableFlags(true); Loading @@ -174,18 +138,6 @@ public class CellularSecurityNotificationsPreferenceControllerTest { assertThat(mController.isChecked()).isTrue(); } @Test public void isChecked_flagsDisabled_shouldReturnFalse() { enableFlags(false); // Hardware support is enabled doReturn(true).when(mTelephonyManager).isNullCipherNotificationsEnabled(); doReturn(true).when(mTelephonyManager) .isCellularIdentifierDisclosureNotificationsEnabled(); assertThat(mController.isChecked()).isFalse(); } @Test public void isChecked_hardwareUnsupported_shouldReturnFalse() { enableFlags(true); Loading Loading
tests/unit/src/com/android/settings/network/telephony/CellularSecurityNotificationsPreferenceControllerTest.java +0 −48 Original line number Diff line number Diff line Loading @@ -112,42 +112,6 @@ public class CellularSecurityNotificationsPreferenceControllerTest { assertThat(mController.getAvailabilityStatus()).isEqualTo(UNSUPPORTED_ON_DEVICE); } @Test public void setChecked_flagsDisabled_shouldReturnFalse() { // Flags disabled enableFlags(false); // Hardware support is enabled doNothing().when(mTelephonyManager).setNullCipherNotificationsEnabled(true); doNothing().when(mTelephonyManager) .setEnableCellularIdentifierDisclosureNotifications(true); assertThat(mController.setChecked(false)).isFalse(); assertThat(mController.setChecked(true)).isFalse(); // Enable 1 flag, make sure it still fails mSetFlagsRule.enableFlags(Flags.FLAG_ENABLE_MODEM_CIPHER_TRANSPARENCY_UNSOL_EVENTS); assertThat(mController.setChecked(false)).isFalse(); assertThat(mController.setChecked(true)).isFalse(); } @Test public void setChecked_hardwareDisabled_shouldReturnFalse() { // Flags disabled enableFlags(false); // Hardware support is enabled doNothing().when(mTelephonyManager).setNullCipherNotificationsEnabled(true); doNothing().when(mTelephonyManager) .setEnableCellularIdentifierDisclosureNotifications(true); assertThat(mController.setChecked(true)).isFalse(); // Hardware support is enabled, called with false doNothing().when(mTelephonyManager).setNullCipherNotificationsEnabled(false); doNothing().when(mTelephonyManager) .setEnableCellularIdentifierDisclosureNotifications(false); assertThat(mController.setChecked(false)).isFalse(); } @Test public void setChecked_shouldReturnTrue() { enableFlags(true); Loading @@ -174,18 +138,6 @@ public class CellularSecurityNotificationsPreferenceControllerTest { assertThat(mController.isChecked()).isTrue(); } @Test public void isChecked_flagsDisabled_shouldReturnFalse() { enableFlags(false); // Hardware support is enabled doReturn(true).when(mTelephonyManager).isNullCipherNotificationsEnabled(); doReturn(true).when(mTelephonyManager) .isCellularIdentifierDisclosureNotificationsEnabled(); assertThat(mController.isChecked()).isFalse(); } @Test public void isChecked_hardwareUnsupported_shouldReturnFalse() { enableFlags(true); Loading