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

Commit 766d956a authored by Yashdev Singh's avatar Yashdev Singh Committed by Luca Stefani
Browse files

Telephony: Enable data call on CSIM.

- Let DCT get mcc/mnc from phone object.
- GsmCdmaPhone would return mcc/mnc as follow...
    - If phoneType is GSM then mcc/mnc from SimRecords
    - If phoneType is CdmaLte then
        If CdmaSubscriptionSource is NV
            mcc/mnc from ro.cdma.home.operator.numeric
        Else
            If SimRecords present then mcc/mnc from this recored.
            Else mcc/mnc from RuimRecords.

- ApnSettings UI would always display list of APNs based on mcc/mnc of GsmCdmaPhone.
    - CDMA operators having LTE
        - APN UI would list LTE apn profile since mcc/mnc is from SimRecords.
    - Legacy CDMA operators
        - APN UI would be empty since such simcard would not have Sim/Usim app.
        - OEM must add profile in apns-conf.xml for such operators.

Change-Id: Ib8fd65eb8b18661d76a71ee24f1e732fb467d5c4
parent 6f8f3558
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -2541,6 +2541,7 @@ public class GsmCdmaPhone extends Phone {
                }
                mUiccApplication.set(newUiccApplication);
                mIccRecords.set(newUiccApplication.getIccRecords());
                logd("mIccRecords = " + mIccRecords);
                registerForIccRecordEvents();
                mIccPhoneBookIntManager.updateIccRecords(mIccRecords.get());
            }
@@ -3305,6 +3306,8 @@ public class GsmCdmaPhone extends Phone {
        pw.println("GsmCdmaPhone extends:");
        super.dump(fd, pw, args);
        pw.println(" mPrecisePhoneType=" + mPrecisePhoneType);
        pw.println(" mSimRecords=" + mSimRecords);
        pw.println(" mIsimUiccRecords=" + mIsimUiccRecords);
        pw.println(" mCT=" + mCT);
        pw.println(" mSST=" + mSST);
        pw.println(" mPendingMMIs=" + mPendingMMIs);
@@ -3372,7 +3375,8 @@ public class GsmCdmaPhone extends Phone {
    /**
     * @return operator numeric.
     */
    private String getOperatorNumeric() {
    @Override
    public String getOperatorNumeric() {
        String operatorNumeric = null;
        if (isPhoneTypeGsm()) {
            IccRecords r = mIccRecords.get();
+4 −0
Original line number Diff line number Diff line
@@ -3521,6 +3521,10 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
    public void cancelUSSD() {
    }

    public String getOperatorNumeric() {
        return "";
    }

    /**
     * Set boolean broadcastEmergencyCallStateChanges
     */
+3 −4
Original line number Diff line number Diff line
@@ -409,12 +409,10 @@ public class SubscriptionInfoUpdater extends Handler {
            updateSubscriptionInfoByIccId();
            int[] subIds = mSubscriptionManager.getActiveSubscriptionIdList();
            for (int subId : subIds) {
                TelephonyManager tm = TelephonyManager.getDefault();

                String operator = tm.getSimOperatorNumeric(subId);
                String operator = mPhone[slotId].getOperatorNumeric();
                slotId = SubscriptionController.getInstance().getPhoneId(subId);

                if (!TextUtils.isEmpty(operator)) {
                if (operator != null && !TextUtils.isEmpty(operator)) {
                    if (subId == SubscriptionController.getInstance().getDefaultSubId()) {
                        MccTable.updateMccMncConfiguration(mContext, operator, false);
                    }
@@ -423,6 +421,7 @@ public class SubscriptionInfoUpdater extends Handler {
                    logd("EVENT_RECORDS_LOADED Operator name is null");
                }

                TelephonyManager tm = TelephonyManager.getDefault();
                String msisdn = tm.getLine1Number(subId);
                ContentResolver contentResolver = mContext.getContentResolver();

+5 −6
Original line number Diff line number Diff line
@@ -1731,7 +1731,7 @@ public class DcTracker extends Handler {
        }
        int bearer = mPhone.getServiceState().getRilDataRadioTechnology();
        IccRecords r = mIccRecords.get();
        String operator = (r != null) ? r.getOperatorNumeric() : "";
        String operator = mPhone.getOperatorNumeric();
        ArrayList<ApnSetting> dunCandidates = new ArrayList<ApnSetting>();
        ApnSetting retDunSetting = null;

@@ -3360,7 +3360,7 @@ public class DcTracker extends Handler {
        mMvnoMatched = false;
        mAllApnSettings = new ArrayList<>();
        IccRecords r = mIccRecords.get();
        String operator = (r != null) ? r.getOperatorNumeric() : "";
        String operator = mPhone.getOperatorNumeric();
        if (operator != null) {
            String selection = Telephony.Carriers.NUMERIC + " = '" + operator + "'";
            // query only enabled apn.
@@ -3503,8 +3503,7 @@ public class DcTracker extends Handler {
            }
        }

        IccRecords r = mIccRecords.get();
        String operator = (r != null) ? r.getOperatorNumeric() : "";
        String operator = mPhone.getOperatorNumeric();

        // This is a workaround for a bug (7305641) where we don't failover to other
        // suitable APNs if our preferred APN fails.  On prepaid ATT sims we need to
@@ -3527,7 +3526,7 @@ public class DcTracker extends Handler {
                    + " canSetPreferApn=" + mCanSetPreferApn
                    + " mPreferredApn=" + mPreferredApn
                    + " operator=" + operator + " radioTech=" + radioTech
                    + " IccRecords r=" + r);
                    + " IccRecords r=" + mIccRecords);
        }

        if (usePreferred && mCanSetPreferApn && mPreferredApn != null &&
@@ -4054,7 +4053,7 @@ public class DcTracker extends Handler {
            return;
        }

        IccRecords newIccRecords = getUiccRecords(UiccController.APP_FAM_3GPP);
        IccRecords newIccRecords = mPhone.getIccRecords();

        IccRecords r = mIccRecords.get();
        if (r != newIccRecords) {
+4 −1
Original line number Diff line number Diff line
@@ -40,7 +40,9 @@ import com.android.internal.telephony.IntentBroadcaster;
import com.android.internal.telephony.MccTable;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.PhoneFactory;
import com.android.internal.telephony.RILConstants;
import com.android.internal.telephony.SubscriptionController;
import com.android.internal.telephony.TelephonyIntents;
import com.android.internal.telephony.cdma.CdmaSubscriptionSourceManager;
import com.android.internal.telephony.uicc.IccCardApplicationStatus.AppState;
@@ -256,7 +258,8 @@ public class IccCardProxy extends Handler implements IccCard {
            case EVENT_RECORDS_LOADED:
                // Update the MCC/MNC.
                if (mIccRecords != null) {
                    String operator = mIccRecords.getOperatorNumeric();
                    Phone currentPhone = PhoneFactory.getPhone(mPhoneId);
                    String operator = currentPhone.getOperatorNumeric();
                    log("operator=" + operator + " mPhoneId=" + mPhoneId);

                    if (!TextUtils.isEmpty(operator)) {