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

Commit 2df8a14c authored by Sungmin Choi's avatar Sungmin Choi Committed by Vineeta Srivastava
Browse files

Fix to return mno dun apn when mvno is not matched

If different type with same apn in apns-conf.xml,
apn should merge through createApnList() -> dedupeApnSettings()
but tethering apn will be chosen by fetchDunApn().
So, apn merge does not work in spite of using same apn.

This will cause make a another requestNetwork with same apn.
In this case, Hotspot is not working.

BUG=25331132

Change-Id: I43de74b93c919b0060b3ecc473b048f3c917e729
parent 10aac5c0
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -1212,7 +1212,14 @@ public final class DcTracker extends DcTrackerBase {
            } while (cursor.moveToNext());
        }

        ArrayList<ApnSetting> result = mvnoApns.isEmpty() ? mnoApns : mvnoApns;
        ArrayList<ApnSetting> result;
        if (mvnoApns.isEmpty()) {
            result = mnoApns;
            // mMvnoMatched = false; - not needed as cleared in createAllApnList
        } else {
            result = mvnoApns;
            mMvnoMatched = true;
        }
        if (DBG) log("createApnList: X result=" + result);
        return result;
    }
@@ -2257,6 +2264,7 @@ public final class DcTracker extends DcTrackerBase {
     * Data Connections and setup the preferredApn.
     */
    private void createAllApnList() {
        mMvnoMatched = false;
        mAllApnSettings = new ArrayList<ApnSetting>();
        IccRecords r = mIccRecords.get();
        String operator = (r != null) ? r.getOperatorNumeric() : "";
+5 −2
Original line number Diff line number Diff line
@@ -240,6 +240,9 @@ public abstract class DcTrackerBase extends Handler {
    //        really a lower power mode")
    protected boolean mIsScreenOn = true;

    // Indicates if we found mvno-specific APNs in the full APN list.
    protected boolean mMvnoMatched = false;

    /** Allows the generation of unique Id's for DataConnection objects */
    protected AtomicInteger mUniqueIdGenerator = new AtomicInteger(0);

@@ -710,7 +713,7 @@ public abstract class DcTrackerBase extends Handler {
                        }
                        return dunSetting;
                    }
                } else {
                } else if (mMvnoMatched == false) {
                    if (VDBG) log("fetchDunApn: global TETHER_DUN_APN dunSetting=" + dunSetting);
                    return dunSetting;
                }
@@ -731,7 +734,7 @@ public abstract class DcTrackerBase extends Handler {
                        }
                        return dunSetting;
                    }
                } else {
                } else if (mMvnoMatched == false) {
                    retDunSetting = dunSetting;
                }
            }