Merge "Change Toggle UX to "Require encryption""

This commit is contained in:
Gil Cukierman
2023-01-17 14:13:07 +00:00
committed by Android (Google) Code Review
4 changed files with 22 additions and 24 deletions

View File

@@ -142,22 +142,22 @@ public final class NullAlgorithmsPreferenceControllerTest {
}
@Test
public void setChecked_true() {
public void setChecked_true_nullCiphersDisabled() {
mController.setChecked(true);
verify(mTelephonyManager, times(1)).setNullCipherAndIntegrityEnabled(true);
verify(mTelephonyManager, times(1)).setNullCipherAndIntegrityEnabled(false);
}
@Test
public void setChecked_false() {
public void setChecked_false_nullCiphersEnabled() {
mController.setChecked(false);
verify(mTelephonyManager, times(1)).setNullCipherAndIntegrityEnabled(false);
verify(mTelephonyManager, times(1)).setNullCipherAndIntegrityEnabled(true);
}
@Test
public void setChecked_exceptionThrown() {
doThrow(IllegalStateException.class).when(
mTelephonyManager).setNullCipherAndIntegrityEnabled(true);
assertFalse(mController.setChecked(true));
assertFalse(mController.setChecked(false));
verify(mTelephonyManager, times(1)).setNullCipherAndIntegrityEnabled(true);
}
}