Merge "The Network Select shows wrong operator name" into sc-dev

This commit is contained in:
SongFerng Wang
2021-04-12 02:45:52 +00:00
committed by Android (Google) Code Review
3 changed files with 2 additions and 10 deletions

View File

@@ -648,12 +648,8 @@ public class MobileNetworkUtils {
return getOperatorNameFromTelephonyManager(context); return getOperatorNameFromTelephonyManager(context);
} }
private static SubscriptionInfo getSubscriptionInfo(SubscriptionManager subManager, private static SubscriptionInfo getSubscriptionInfo(SubscriptionManager subManager, int subId) {
int subId) { List<SubscriptionInfo> subInfos = subManager.getActiveSubscriptionInfoList();
List<SubscriptionInfo> subInfos = subManager.getAccessibleSubscriptionInfoList();
if (subInfos == null) {
subInfos = subManager.getActiveSubscriptionInfoList();
}
if (subInfos == null) { if (subInfos == null) {
return null; return null;
} }

View File

@@ -132,8 +132,6 @@ public class MobileNetworkUtilsTest {
when(mSubscriptionManager.getActiveSubscriptionInfoList()).thenReturn( when(mSubscriptionManager.getActiveSubscriptionInfoList()).thenReturn(
Arrays.asList(mSubscriptionInfo1, mSubscriptionInfo2)); Arrays.asList(mSubscriptionInfo1, mSubscriptionInfo2));
when(mSubscriptionManager.getAccessibleSubscriptionInfoList()).thenReturn(
Arrays.asList(mSubscriptionInfo1, mSubscriptionInfo2));
when(mTelephonyManager.getNetworkOperatorName()).thenReturn( when(mTelephonyManager.getNetworkOperatorName()).thenReturn(
PLMN_FROM_TELEPHONY_MANAGER_API); PLMN_FROM_TELEPHONY_MANAGER_API);

View File

@@ -88,8 +88,6 @@ public class OpenNetworkSelectPagePreferenceControllerTest {
when(mSubscriptionManager.getActiveSubscriptionInfoList()).thenReturn( when(mSubscriptionManager.getActiveSubscriptionInfoList()).thenReturn(
Arrays.asList(mSubscriptionInfo)); Arrays.asList(mSubscriptionInfo));
when(mSubscriptionManager.getAccessibleSubscriptionInfoList()).thenReturn(
Arrays.asList(mSubscriptionInfo));
when(mTelephonyManager.getNetworkOperatorName()).thenReturn(OPERATOR_NAME); when(mTelephonyManager.getNetworkOperatorName()).thenReturn(OPERATOR_NAME);