Avoid wrong telephonymanager with wrong sub id. am: ba845f7fe4
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/13422724 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I68a58e6ba10fbae2625ab76ff0f079550b4426c9
This commit is contained in:
@@ -233,7 +233,8 @@ public class SimStatusDialogController implements LifecycleObserver {
|
|||||||
if (mSubscriptionInfo == null) {
|
if (mSubscriptionInfo == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
mTelephonyManager =
|
||||||
|
mTelephonyManager.createForSubscriptionId(mSubscriptionInfo.getSubscriptionId());
|
||||||
mPhoneStateListener = getPhoneStateListener();
|
mPhoneStateListener = getPhoneStateListener();
|
||||||
updateLatestAreaInfo();
|
updateLatestAreaInfo();
|
||||||
updateSubscriptionStatus();
|
updateSubscriptionStatus();
|
||||||
|
@@ -136,7 +136,7 @@ public class SimStatusDialogControllerTest {
|
|||||||
when(mContext.getSystemService(SubscriptionManager.class)).thenReturn(mSubscriptionManager);
|
when(mContext.getSystemService(SubscriptionManager.class)).thenReturn(mSubscriptionManager);
|
||||||
|
|
||||||
doReturn(mTelephonyManager).when(mTelephonyManager).createForSubscriptionId(
|
doReturn(mTelephonyManager).when(mTelephonyManager).createForSubscriptionId(
|
||||||
SubscriptionManager.DEFAULT_SUBSCRIPTION_ID);
|
anyInt());
|
||||||
doReturn(2).when(mTelephonyManager).getCardIdForDefaultEuicc();
|
doReturn(2).when(mTelephonyManager).getCardIdForDefaultEuicc();
|
||||||
doReturn(TelephonyManager.NETWORK_TYPE_LTE).when(mTelephonyManager).getDataNetworkType();
|
doReturn(TelephonyManager.NETWORK_TYPE_LTE).when(mTelephonyManager).getDataNetworkType();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user