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

Commit f46817da authored by Alex Yakavenka's avatar Alex Yakavenka
Browse files

Create ApnSetting if none are found in database.

Bug: 9315957
Change-Id: I0cf0debb703f6a4cad35300315922a5566871f85
parent 06f093f7
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneBase;
import com.android.internal.telephony.DctConstants;
import com.android.internal.telephony.EventLogTags;
import com.android.internal.telephony.TelephonyProperties;
import com.android.internal.telephony.gsm.GSMPhone;
import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.RILConstants;
@@ -1824,6 +1825,23 @@ public final class DcTracker extends DcTrackerBase {
            }
        }

        if (mAllApnSettings.isEmpty() && mPhone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
            // Create dummy data profile.
            if (DBG) log("createAllApnList: Creating dummy apn for cdma operator:" + operator);
            String[] mDefaultApnTypes = {
                    PhoneConstants.APN_TYPE_DEFAULT,
                    PhoneConstants.APN_TYPE_MMS,
                    PhoneConstants.APN_TYPE_SUPL,
                    PhoneConstants.APN_TYPE_HIPRI,
                    PhoneConstants.APN_TYPE_FOTA,
                    PhoneConstants.APN_TYPE_IMS,
                    PhoneConstants.APN_TYPE_CBS };
            ApnSetting apn = new ApnSetting(apnTypeToId(PhoneConstants.APN_TYPE_DEFAULT), operator,
                    null, null, null, null, null, null, null, null, null,
                    RILConstants.SETUP_DATA_AUTH_PAP_CHAP, mDefaultApnTypes, "IP", "IP", true, 0);
            mAllApnSettings.add(apn);
        }

        if (mAllApnSettings.isEmpty()) {
            if (DBG) log("createAllApnList: No APN found for carrier: " + operator);
            mPreferredApn = null;