Merge "Fix redirect to Mobile security page" into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
9571a0d353
@@ -125,7 +125,7 @@ public class CellularSecurityPreferenceController extends BasePreferenceControll
|
|||||||
return super.handlePreferenceTreeClick(preference);
|
return super.handlePreferenceTreeClick(preference);
|
||||||
}
|
}
|
||||||
boolean isSafetyCenterSupported = isSafetyCenterSupported();
|
boolean isSafetyCenterSupported = isSafetyCenterSupported();
|
||||||
if (isSafetyCenterSupported) {
|
if (isSafetyCenterSupported && areNotificationsEnabled()) {
|
||||||
Intent safetyCenterIntent = new Intent(Intent.ACTION_SAFETY_CENTER);
|
Intent safetyCenterIntent = new Intent(Intent.ACTION_SAFETY_CENTER);
|
||||||
safetyCenterIntent.putExtra(SafetyCenterManager.EXTRA_SAFETY_SOURCES_GROUP_ID,
|
safetyCenterIntent.putExtra(SafetyCenterManager.EXTRA_SAFETY_SOURCES_GROUP_ID,
|
||||||
"AndroidCellularNetworkSecuritySources");
|
"AndroidCellularNetworkSecuritySources");
|
||||||
|
@@ -152,6 +152,10 @@ public final class CellularSecurityPreferenceControllerTest {
|
|||||||
public void handlePreferenceTreeClick_safetyCenterSupported_shouldRedirectToSafetyCenter() {
|
public void handlePreferenceTreeClick_safetyCenterSupported_shouldRedirectToSafetyCenter() {
|
||||||
final ArgumentCaptor<Intent> intentCaptor = ArgumentCaptor.forClass(Intent.class);
|
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);
|
boolean prefHandled = mController.handlePreferenceTreeClick(mPreference);
|
||||||
|
|
||||||
assertThat(prefHandled).isTrue();
|
assertThat(prefHandled).isTrue();
|
||||||
|
Reference in New Issue
Block a user