Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ba845f7f authored by tom hsu's avatar tom hsu Committed by Tom Hsu
Browse files

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
parent f38af988
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -233,7 +233,8 @@ public class SimStatusDialogController implements LifecycleObserver {
        if (mSubscriptionInfo == null) {
            return;
        }

        mTelephonyManager =
            mTelephonyManager.createForSubscriptionId(mSubscriptionInfo.getSubscriptionId());
        mPhoneStateListener = getPhoneStateListener();
        updateLatestAreaInfo();
        updateSubscriptionStatus();
+1 −1
Original line number Diff line number Diff line
@@ -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();