Change Toggle UX to "Require encryption"

Changes the UX of enable/disable null ciphers to
"Require encryption". The default value is off, making
the default behavior equivalent to the previous version
of the toggle.

Test: atest NullAlgorithmsPreferenceControllerTest
Test: Manual testing in cuttlefish
Bug: 264540492
Change-Id: Iaa0c9c259559a205aacad9fb9af8de6b54782c8d
This commit is contained in:
Gil Cukierman
2023-01-11 18:42:05 +00:00
parent c9e42d4d73
commit 0251b272aa
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);
}
}