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 Test: make RunSettingsRoboTests ROBOTEST_FILTER=SimStatusDialogControllerTest passed Change-Id: I6bd6975e39c75884252b9d0bcd9d5548dbdfe6d5 Merged-In: I6bd6975e39c75884252b9d0bcd9d5548dbdfe6d5
This commit is contained in:
@@ -228,7 +228,8 @@ public class SimStatusDialogController implements LifecycleObserver, OnResume, O
|
||||
if (mSubscriptionInfo == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
mTelephonyManager =
|
||||
mTelephonyManager.createForSubscriptionId(mSubscriptionInfo.getSubscriptionId());
|
||||
mPhoneStateListener = getPhoneStateListener();
|
||||
updateLatestAreaInfo();
|
||||
updateSubscriptionStatus();
|
||||
|
@@ -162,6 +162,8 @@ public class SimStatusDialogControllerTest {
|
||||
doReturn(null).when(mSignalStrength).getCellSignalStrengths();
|
||||
doReturn(mPhoneStateListener).when(mController).getPhoneStateListener();
|
||||
doReturn(mSubscriptionInfo).when(mSubscriptionManager).getActiveSubscriptionInfo(anyInt());
|
||||
when(mSubscriptionInfo.getSubscriptionId())
|
||||
.thenReturn(SubscriptionManager.DEFAULT_SUBSCRIPTION_ID);
|
||||
|
||||
ReflectionHelpers.setField(mController, "mTelephonyManager", mTelephonyManager);
|
||||
ReflectionHelpers.setField(mController, "mCarrierConfigManager", mCarrierConfigManager);
|
||||
|
Reference in New Issue
Block a user