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

Commit 7725180c authored by Robert Greenwalt's avatar Robert Greenwalt
Browse files

Prefer the preferred APN for all types it supports

We used to only prefer it when connecting for default connection purposes,
but it makes sense to use the preference for all apn types it supports.

bug:6377793
Change-Id: I8b26b77fc0787121749cce9d32303ab24cc72c75
parent 867b96bd
Loading
Loading
Loading
Loading
+14 −15
Original line number Diff line number Diff line
@@ -2322,8 +2322,8 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
        String operator = mPhone.mIccRecords.getOperatorNumeric();
        int networkType = mPhone.getServiceState().getNetworkType();

        if (requestedApnType.equals(Phone.APN_TYPE_DEFAULT)) {
            if (canSetPreferApn && mPreferredApn != null) {
        if (canSetPreferApn && mPreferredApn != null &&
                mPreferredApn.canHandleType(requestedApnType)) {
            if (DBG) {
                log("buildWaitingApns: Preferred APN:" + operator + ":"
                        + mPreferredApn.numeric + ":" + mPreferredApn);
@@ -2344,7 +2344,6 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
                mPreferredApn = null;
            }
        }
        }
        if (mAllApns != null) {
            for (ApnSetting apn : mAllApns) {
                if (apn.canHandleType(requestedApnType)) {