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

Commit 0bf4d2a5 authored by Sneh Bansal's avatar Sneh Bansal Committed by Bruno Martins
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.

CRs-Fixed: 2178887
Change-Id: Ib8fd65eb8b18661d76a71ee24f1e732fb467d5c4
parent 7b8b8020
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -2656,6 +2656,7 @@ public class GsmCdmaPhone extends Phone {
                }
                mUiccApplication.set(newUiccApplication);
                mIccRecords.set(newUiccApplication.getIccRecords());
                logd("mIccRecords = " + mIccRecords);
                registerForIccRecordEvents();
                mIccPhoneBookIntManager.updateIccRecords(mIccRecords.get());
            }
@@ -3455,6 +3456,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);
@@ -3510,7 +3513,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
@@ -3583,6 +3583,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
@@ -382,12 +382,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);
                    }
@@ -396,6 +394,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
@@ -1735,7 +1735,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>();
        ArrayList<ApnSetting> retDunSettings = new ArrayList<ApnSetting>();

@@ -3353,7 +3353,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.
@@ -3505,8 +3505,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
@@ -3529,7 +3528,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 &&
@@ -4082,7 +4081,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) {