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

Commit 5cbd7de5 authored by Muhammed Siju's avatar Muhammed Siju Committed by Ed Carrigan
Browse files

Fix MMS sending issue in LTE on CDMA networks.

For CDMA-LTE mode, operator numeric based on USIM is used for configuring
MMSC settings in APN db. Currently CSIM based operator numeric is set
as current carrier in CDMALTEPhone and hence MMS app cannot find MMSC
setting when camped to LTE in CDMA-LTE mode.
However for CDMA only networks, MMSC settings are added based on CSIM/RUIM
operator numeric.
To make both configurations work, update the current carrier operator
numeric based on current data RAT from DcTracker.
Also make sure that only DcTracker updates the current carrier in case of
CDMA/CDMA-LTE modes to avoid overwriting with wrong value in case of multi
app UICC cards.

Change-Id: I465369811520cf345605ad70d7dadf9532b74017
CRs-Fixed: 642640
parent c8e12dc3
Loading
Loading
Loading
Loading
+0 −21
Original line number Diff line number Diff line
@@ -200,27 +200,6 @@ public class CDMALTEPhone extends CDMAPhone {

    }


    /**
     * Sets the "current" field in the telephony provider according to the
     * build-time operator numeric property
     *
     * @return true for success; false otherwise.
     */
    @Override
    boolean updateCurrentCarrierInProvider(String operatorNumeric) {
        boolean retVal;
        if (mUiccController.getUiccCardApplication(UiccController.APP_FAM_3GPP) == null) {
            if (DBG) log("updateCurrentCarrierInProvider APP_FAM_3GPP == null");
            retVal = super.updateCurrentCarrierInProvider(operatorNumeric);
        } else {
            if (DBG) log("updateCurrentCarrierInProvider not updated");
            retVal = true;
        }
        if (DBG) log("updateCurrentCarrierInProvider X retVal=" + retVal);
        return retVal;
    }

    @Override
    public boolean updateCurrentCarrierInProvider() {
        if (mSimRecords != null) {
+4 −5
Original line number Diff line number Diff line
@@ -1126,7 +1126,6 @@ public class CDMAPhone extends PhoneBase {

            case EVENT_RUIM_RECORDS_LOADED:{
                Rlog.d(LOG_TAG, "Event EVENT_RUIM_RECORDS_LOADED Received");
                updateCurrentCarrierInProvider();
            }
            break;

@@ -1573,19 +1572,19 @@ public class CDMAPhone extends PhoneBase {
    }

    /**
     * Sets the "current" field in the telephony provider according to the
     * build-time operator numeric property
     * Sets the "current" field in the telephony provider to the
     * operator numeric passed.
     *
     * @return true for success; false otherwise.
     */
    boolean updateCurrentCarrierInProvider(String operatorNumeric) {
    public boolean updateCurrentCarrierInProvider(String operatorNumeric) {
        log("CDMAPhone: updateCurrentCarrierInProvider called");
        if (!TextUtils.isEmpty(operatorNumeric)) {
            try {
                Uri uri = Uri.withAppendedPath(Telephony.Carriers.CONTENT_URI, "current");
                ContentValues map = new ContentValues();
                map.put(Telephony.Carriers.NUMERIC, operatorNumeric);
                log("updateCurrentCarrierInProvider from system: numeric=" + operatorNumeric);
                log("updateCurrentCarrierInProvider with: numeric=" + operatorNumeric);
                getContext().getContentResolver().insert(uri, map);

                // Updates MCC MNC device configuration information
+11 −4
Original line number Diff line number Diff line
@@ -1305,10 +1305,7 @@ public class DcTracker extends DcTrackerBase {
        boolean isDisconnected = (overallState == DctConstants.State.IDLE ||
                overallState == DctConstants.State.FAILED);

        if (mPhone instanceof GSMPhone) {
            // The "current" may no longer be valid.  MMS depends on this to send properly. TBD
            ((GSMPhone)mPhone).updateCurrentCarrierInProvider();
        }
        updateCurrentCarrierInProvider();

        // TODO: It'd be nice to only do this if the changed entrie(s)
        // match the current operator.
@@ -1528,6 +1525,7 @@ public class DcTracker extends DcTrackerBase {

    private void onRecordsLoaded() {
        log("onRecordsLoaded");
        updateCurrentCarrierInProvider();

        if (mOmhDpt != null) {
            log("OMH: onRecordsLoaded(): calling loadProfiles()");
@@ -1551,6 +1549,7 @@ public class DcTracker extends DcTrackerBase {

    private void onNvReady() {
        if (DBG) log("onNvReady");
        updateCurrentCarrierInProvider();
        createAllApnList();
        setupDataOnConnectableApns(Phone.REASON_NV_READY);
    }
@@ -2705,6 +2704,14 @@ public class DcTracker extends DcTrackerBase {
        return result;
    }

    protected void updateCurrentCarrierInProvider() {
        if (mPhone instanceof GSMPhone) {
            ((GSMPhone)mPhone).updateCurrentCarrierInProvider();
        } else if (mPhone instanceof CDMAPhone) {
            ((CDMAPhone)mPhone).updateCurrentCarrierInProvider(getOperatorNumeric());
        }
    }

    @Override
    protected void log(String s) {
        Rlog.d(LOG_TAG, s);