Loading flags/network.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,13 @@ flag { flag { name: "enable_modem_cipher_transparency" namespace: "telephony" description: "Guards APIs for enabling and disabling modem cipher transparency." bug: "283336425" } flag { name: "enable_modem_cipher_transparency_unsol_events" namespace: "telephony" description: "Allows the framework to register for SecurityAlgorithmChanged events and emit notifications to the user when a device is using null ciphers." bug: "283336425" } Loading src/java/com/android/internal/telephony/GsmCdmaPhone.java +18 −7 Original line number Diff line number Diff line Loading @@ -538,9 +538,11 @@ public class GsmCdmaPhone extends Phone { this, EVENT_CELL_IDENTIFIER_DISCLOSURE, null); } if (mFeatureFlags.enableModemCipherTransparency()) { logi("enable_modem_cipher_transparency is on. Registering for security algorithm " + "updates from phone " + getPhoneId()); if (mFeatureFlags.enableModemCipherTransparencyUnsolEvents()) { logi( "enable_modem_cipher_transparency_unsol_events is on. Registering for security " + "algorithm updates from phone " + getPhoneId()); mNullCipherNotifier = mTelephonyComponentFactory .inject(NullCipherNotifier.class.getName()) Loading Loading @@ -3720,7 +3722,8 @@ public class GsmCdmaPhone extends Phone { case EVENT_SECURITY_ALGORITHM_UPDATE: logd("EVENT_SECURITY_ALGORITHM_UPDATE phoneId = " + getPhoneId()); if (mFeatureFlags.enableModemCipherTransparency() && mNullCipherNotifier != null) { if (mFeatureFlags.enableModemCipherTransparencyUnsolEvents() && mNullCipherNotifier != null) { ar = (AsyncResult) msg.obj; SecurityAlgorithmUpdate update = (SecurityAlgorithmUpdate) ar.result; mNullCipherNotifier.onSecurityAlgorithmUpdate(getPhoneId(), update); Loading Loading @@ -5373,11 +5376,19 @@ public class GsmCdmaPhone extends Phone { } boolean prefEnabled = getNullCipherNotificationsPreferenceEnabled(); // The notifier is tied to handling unsolicited updates from the modem, not the // enable/disable API. if (mFeatureFlags.enableModemCipherTransparencyUnsolEvents()) { if (prefEnabled) { mNullCipherNotifier.enable(); } else { mNullCipherNotifier.disable(); } } else { logi( "Not toggling enable state for cipher notifier. Feature flag " + "enable_modem_cipher_transparency_unsol_events is disabled."); } mCi.setSecurityAlgorithmsUpdatedEnabled(prefEnabled, obtainMessage(EVENT_SET_SECURITY_ALGORITHMS_UPDATED_ENABLED_DONE)); Loading tests/telephonytests/src/com/android/internal/telephony/GsmCdmaPhoneTest.java +4 −2 Original line number Diff line number Diff line Loading @@ -2947,7 +2947,7 @@ public class GsmCdmaPhoneTest extends TelephonyTest { @Test public void testSecurityAlgorithmUpdateFlagOn() { when(mFeatureFlags.enableModemCipherTransparency()).thenReturn(true); when(mFeatureFlags.enableModemCipherTransparencyUnsolEvents()).thenReturn(true); Phone phoneUT = makeNewPhoneUT(); Loading @@ -2960,7 +2960,7 @@ public class GsmCdmaPhoneTest extends TelephonyTest { @Test public void testSecurityAlgorithm_updateAddedToNotifier() { when(mFeatureFlags.enableModemCipherTransparency()).thenReturn(true); when(mFeatureFlags.enableModemCipherTransparencyUnsolEvents()).thenReturn(true); Phone phoneUT = makeNewPhoneUT(); SecurityAlgorithmUpdate update = new SecurityAlgorithmUpdate( Loading Loading @@ -3022,6 +3022,7 @@ public class GsmCdmaPhoneTest extends TelephonyTest { @Test public void testNullCipherNotification_preferenceEnabled() { when(mFeatureFlags.enableModemCipherTransparency()).thenReturn(true); when(mFeatureFlags.enableModemCipherTransparencyUnsolEvents()).thenReturn(true); GsmCdmaPhone phoneUT = makeNewPhoneUT(); setNullCipherNotificationPreferenceEnabled(true); Loading @@ -3035,6 +3036,7 @@ public class GsmCdmaPhoneTest extends TelephonyTest { @Test public void testNullCipherNotification_preferenceDisabled() { when(mFeatureFlags.enableModemCipherTransparency()).thenReturn(true); when(mFeatureFlags.enableModemCipherTransparencyUnsolEvents()).thenReturn(true); GsmCdmaPhone phoneUT = makeNewPhoneUT(); setNullCipherNotificationPreferenceEnabled(false); Loading Loading
flags/network.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,13 @@ flag { flag { name: "enable_modem_cipher_transparency" namespace: "telephony" description: "Guards APIs for enabling and disabling modem cipher transparency." bug: "283336425" } flag { name: "enable_modem_cipher_transparency_unsol_events" namespace: "telephony" description: "Allows the framework to register for SecurityAlgorithmChanged events and emit notifications to the user when a device is using null ciphers." bug: "283336425" } Loading
src/java/com/android/internal/telephony/GsmCdmaPhone.java +18 −7 Original line number Diff line number Diff line Loading @@ -538,9 +538,11 @@ public class GsmCdmaPhone extends Phone { this, EVENT_CELL_IDENTIFIER_DISCLOSURE, null); } if (mFeatureFlags.enableModemCipherTransparency()) { logi("enable_modem_cipher_transparency is on. Registering for security algorithm " + "updates from phone " + getPhoneId()); if (mFeatureFlags.enableModemCipherTransparencyUnsolEvents()) { logi( "enable_modem_cipher_transparency_unsol_events is on. Registering for security " + "algorithm updates from phone " + getPhoneId()); mNullCipherNotifier = mTelephonyComponentFactory .inject(NullCipherNotifier.class.getName()) Loading Loading @@ -3720,7 +3722,8 @@ public class GsmCdmaPhone extends Phone { case EVENT_SECURITY_ALGORITHM_UPDATE: logd("EVENT_SECURITY_ALGORITHM_UPDATE phoneId = " + getPhoneId()); if (mFeatureFlags.enableModemCipherTransparency() && mNullCipherNotifier != null) { if (mFeatureFlags.enableModemCipherTransparencyUnsolEvents() && mNullCipherNotifier != null) { ar = (AsyncResult) msg.obj; SecurityAlgorithmUpdate update = (SecurityAlgorithmUpdate) ar.result; mNullCipherNotifier.onSecurityAlgorithmUpdate(getPhoneId(), update); Loading Loading @@ -5373,11 +5376,19 @@ public class GsmCdmaPhone extends Phone { } boolean prefEnabled = getNullCipherNotificationsPreferenceEnabled(); // The notifier is tied to handling unsolicited updates from the modem, not the // enable/disable API. if (mFeatureFlags.enableModemCipherTransparencyUnsolEvents()) { if (prefEnabled) { mNullCipherNotifier.enable(); } else { mNullCipherNotifier.disable(); } } else { logi( "Not toggling enable state for cipher notifier. Feature flag " + "enable_modem_cipher_transparency_unsol_events is disabled."); } mCi.setSecurityAlgorithmsUpdatedEnabled(prefEnabled, obtainMessage(EVENT_SET_SECURITY_ALGORITHMS_UPDATED_ENABLED_DONE)); Loading
tests/telephonytests/src/com/android/internal/telephony/GsmCdmaPhoneTest.java +4 −2 Original line number Diff line number Diff line Loading @@ -2947,7 +2947,7 @@ public class GsmCdmaPhoneTest extends TelephonyTest { @Test public void testSecurityAlgorithmUpdateFlagOn() { when(mFeatureFlags.enableModemCipherTransparency()).thenReturn(true); when(mFeatureFlags.enableModemCipherTransparencyUnsolEvents()).thenReturn(true); Phone phoneUT = makeNewPhoneUT(); Loading @@ -2960,7 +2960,7 @@ public class GsmCdmaPhoneTest extends TelephonyTest { @Test public void testSecurityAlgorithm_updateAddedToNotifier() { when(mFeatureFlags.enableModemCipherTransparency()).thenReturn(true); when(mFeatureFlags.enableModemCipherTransparencyUnsolEvents()).thenReturn(true); Phone phoneUT = makeNewPhoneUT(); SecurityAlgorithmUpdate update = new SecurityAlgorithmUpdate( Loading Loading @@ -3022,6 +3022,7 @@ public class GsmCdmaPhoneTest extends TelephonyTest { @Test public void testNullCipherNotification_preferenceEnabled() { when(mFeatureFlags.enableModemCipherTransparency()).thenReturn(true); when(mFeatureFlags.enableModemCipherTransparencyUnsolEvents()).thenReturn(true); GsmCdmaPhone phoneUT = makeNewPhoneUT(); setNullCipherNotificationPreferenceEnabled(true); Loading @@ -3035,6 +3036,7 @@ public class GsmCdmaPhoneTest extends TelephonyTest { @Test public void testNullCipherNotification_preferenceDisabled() { when(mFeatureFlags.enableModemCipherTransparency()).thenReturn(true); when(mFeatureFlags.enableModemCipherTransparencyUnsolEvents()).thenReturn(true); GsmCdmaPhone phoneUT = makeNewPhoneUT(); setNullCipherNotificationPreferenceEnabled(false); Loading