The Network Select shows wrong operator name
It get the empty subscriptionInfoList from SubscriptionManager#getAccessibleSubscriptionInfoList, so the UI shows default subId's operator. Since this item appears, when sim is active, using getActiveSubscriptionInfoList is enough. - https://screenshot.googleplex.com/9aHtDVpnYQBsiQr Bug: 182020952 Test: atest MobileNetworkUtilsTest atest OpenNetworkSelectPagePreferenceControllerTest Change-Id: I0d86ec41236a0d1be657ccd57fd0cf90f96b8b89
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
@@ -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);
|
||||||
|
@@ -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);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user