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

Commit 5840639f authored by Robert Greenwalt's avatar Robert Greenwalt
Browse files

Fix apn bearer logic.

The original change said that if the RAT were X or Y we would only
accept APN's that explicitly called out X or Y.  This meant that
any device using X or Y would stop working until their APN db were
adjusted.

This change changes it to be if a particular APN calls out X or Y
it will only be considered if the current RAT matches.  If the APN
doesn't specify, it matches all RAT.

This allows just as tight a restriction, but the default is looser.

Change-Id: Ia5e92f13c5052e890bf169e0db9584302afb36f5
parent 745f1e3a
Loading
Loading
Loading
Loading
+2 −15
Original line number Diff line number Diff line
@@ -2086,18 +2086,6 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
        }
    }

    /**
     * Check current radio access technology is LTE or EHRPD.
     *
     * @param integer value of radio access technology
     * @return true when current radio access technology is LTE or EHRPD
     * @	   false when current radio access technology is not LTE or EHRPD
     */
    private boolean needToCheckApnBearer(int radioTech) {
        return (radioTech == ServiceState.RADIO_TECHNOLOGY_LTE ||
                radioTech == ServiceState.RADIO_TECHNOLOGY_EHRPD);
    }

    /**
     * Build a list of APNs to be used to create PDP's.
     *
@@ -2119,7 +2107,6 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {

        String operator = mPhone.mIccRecords.getOperatorNumeric();
        int radioTech = mPhone.getServiceState().getRadioTechnology();
        boolean needToCheckApnBearer = needToCheckApnBearer(radioTech);

        if (requestedApnType.equals(Phone.APN_TYPE_DEFAULT)) {
            if (canSetPreferApn && mPreferredApn != null) {
@@ -2128,7 +2115,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
                        + mPreferredApn.numeric + ":" + mPreferredApn);
                }
                if (mPreferredApn.numeric.equals(operator)) {
                    if (!needToCheckApnBearer || mPreferredApn.bearer == radioTech) {
                    if (mPreferredApn.bearer == 0 || mPreferredApn.bearer == radioTech) {
                        apnList.add(mPreferredApn);
                        if (DBG) log("buildWaitingApns: X added preferred apnList=" + apnList);
                        return apnList;
@@ -2147,7 +2134,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
        if (mAllApns != null) {
            for (ApnSetting apn : mAllApns) {
                if (apn.canHandleType(requestedApnType)) {
                    if (!needToCheckApnBearer || apn.bearer == radioTech) {
                    if (apn.bearer == 0 || apn.bearer == radioTech) {
                        if (DBG) log("apn info : " +apn.toString());
                        apnList.add(apn);
                    }