Avoid wrong telephonymanager with wrong sub id.
When initialized SimStatusDialogController, also create TelephonyManager with sub id. Bug: 174171839 Test: Manual test passed, see b/174171839#25 Change-Id: I6bd6975e39c75884252b9d0bcd9d5548dbdfe6d5
This commit is contained in:
@@ -233,7 +233,8 @@ public class SimStatusDialogController implements LifecycleObserver {
|
||||
if (mSubscriptionInfo == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
mTelephonyManager =
|
||||
mTelephonyManager.createForSubscriptionId(mSubscriptionInfo.getSubscriptionId());
|
||||
mPhoneStateListener = getPhoneStateListener();
|
||||
updateLatestAreaInfo();
|
||||
updateSubscriptionStatus();
|
||||
|
@@ -136,7 +136,7 @@ public class SimStatusDialogControllerTest {
|
||||
when(mContext.getSystemService(SubscriptionManager.class)).thenReturn(mSubscriptionManager);
|
||||
|
||||
doReturn(mTelephonyManager).when(mTelephonyManager).createForSubscriptionId(
|
||||
SubscriptionManager.DEFAULT_SUBSCRIPTION_ID);
|
||||
anyInt());
|
||||
doReturn(2).when(mTelephonyManager).getCardIdForDefaultEuicc();
|
||||
doReturn(TelephonyManager.NETWORK_TYPE_LTE).when(mTelephonyManager).getDataNetworkType();
|
||||
|
||||
|
Reference in New Issue
Block a user