Fix redirect to Mobile security page

When the user first access the Mobile network security settings, they
should not open in Safety Center even if Safety Center is supported.
Until notifications are enabled for hardware security APIs, they should
open in Settings. This is because the Safety Center redirect will fail
if the Safety Source has not begun providing data to Safety Center. Also
update the relevant unit test.

Flag: EXEMPT bugfix
Bug: 373942609
Test: m & atest CellularSecurityNotificationsDividerControllerTest CellularSecurityNotificationsPreferenceControllerTest CellularSecurityEncryptionDividerControllerTest CellularSecurityPreferenceControllerTest
Change-Id: Ica87be4f1567541a6e3ccbe5dd5b674224aa1d8e
This commit is contained in:
yomna
2024-11-21 05:07:58 +00:00
committed by Yomna ~
parent 9b65eafc84
commit 5d8680e193
2 changed files with 5 additions and 1 deletions

View File

@@ -152,6 +152,10 @@ public final class CellularSecurityPreferenceControllerTest {
public void handlePreferenceTreeClick_safetyCenterSupported_shouldRedirectToSafetyCenter() {
final ArgumentCaptor<Intent> intentCaptor = ArgumentCaptor.forClass(Intent.class);
doReturn(true).when(mTelephonyManager).isNullCipherNotificationsEnabled();
doReturn(true).when(mTelephonyManager)
.isCellularIdentifierDisclosureNotificationsEnabled();
doReturn(true).when(mTelephonyManager).isNullCipherAndIntegrityPreferenceEnabled();
boolean prefHandled = mController.handlePreferenceTreeClick(mPreference);
assertThat(prefHandled).isTrue();