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

Commit 17d06563 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Fix to set wrong WFC mode when SIM hot swap"

parents 8ce4fee3 de340897
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -2094,8 +2094,15 @@ public class ImsPhone extends ImsPhoneBase {
        if (mCT.getState() == PhoneConstants.State.IDLE) {
            if (DBG) logd("updateRoamingState now: " + newRoamingState);
            mRoaming = newRoamingState;
            CarrierConfigManager configManager = (CarrierConfigManager)
                    getContext().getSystemService(Context.CARRIER_CONFIG_SERVICE);
            // Don't set wfc mode if carrierconfig has not loaded. It will be set by GsmCdmaPhone
            // when receives ACTION_CARRIER_CONFIG_CHANGED broadcast.
            if (configManager != null && CarrierConfigManager.isConfigForIdentifiedCarrier(
                    configManager.getConfigForSubId(getSubId()))) {
                ImsManager imsManager = ImsManager.getInstance(mContext, mPhoneId);
                imsManager.setWfcMode(imsManager.getWfcMode(newRoamingState), newRoamingState);
            }
        } else {
            if (DBG) logd("updateRoamingState postponed: " + newRoamingState);
            mCT.registerForVoiceCallEnded(this, EVENT_VOICE_CALL_ENDED, null);
+5 −2
Original line number Diff line number Diff line
@@ -116,6 +116,7 @@ public class ImsPhoneTest extends TelephonyTest {
    };

    private ImsPhone mImsPhoneUT;
    private PersistableBundle mBundle;
    private boolean mDoesRilSendMultipleCallRing;
    private static final int EVENT_SUPP_SERVICE_NOTIFICATION = 1;
    private static final int EVENT_SUPP_SERVICE_FAILED = 2;
@@ -157,6 +158,9 @@ public class ImsPhoneTest extends TelephonyTest {
            return null;
        }).when(mPhone).setIsInEcm(anyBoolean());
        doAnswer(invocation -> mIsPhoneUtInEcm).when(mPhone).isInEcm();

        mBundle = mContextFixture.getCarrierConfigBundle();
        mBundle.putBoolean(CarrierConfigManager.KEY_CARRIER_CONFIG_APPLIED_BOOL, true);
        processAllMessages();
    }

@@ -616,8 +620,7 @@ public class ImsPhoneTest extends TelephonyTest {
    @SmallTest
    public void testProcessDisconnectReason() throws Exception {
        // set up CarrierConfig
        PersistableBundle bundle = mContextFixture.getCarrierConfigBundle();
        bundle.putStringArray(CarrierConfigManager.KEY_WFC_OPERATOR_ERROR_CODES_STRING_ARRAY,
        mBundle.putStringArray(CarrierConfigManager.KEY_WFC_OPERATOR_ERROR_CODES_STRING_ARRAY,
                new String[]{"REG09|0"});
        doReturn(true).when(mImsManager).isWfcEnabledByUser();