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

Commit 4a6854f0 authored by Sungmin Choi's avatar Sungmin Choi Committed by Robert Greenwalt
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 3a96b0ee
Loading
Loading
Loading
Loading
+15 −3
Original line number Diff line number Diff line
@@ -566,6 +566,10 @@ public final class DcTracker extends Handler {
    //        really a lower power mode")
    private boolean mIsScreenOn = true;

    // Indicates if we found mvno-specific APNs in the full APN list.
    // used to determine if we can accept mno-specific APN for tethering.
    private boolean mMvnoMatched = false;

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

@@ -1762,7 +1766,7 @@ public final class DcTracker extends Handler {
                        }
                        return dunSetting;
                    }
                } else {
                } else if (mMvnoMatched == false) {
                    if (VDBG) log("fetchDunApn: global TETHER_DUN_APN dunSetting=" + dunSetting);
                    return dunSetting;
                }
@@ -1783,7 +1787,7 @@ public final class DcTracker extends Handler {
                        }
                        return dunSetting;
                    }
                } else {
                } else if (mMvnoMatched == false) {
                    retDunSetting = dunSetting;
                }
            }
@@ -1914,7 +1918,14 @@ public final class DcTracker extends Handler {
            } while (cursor.moveToNext());
        }

        ArrayList<ApnSetting> result = mvnoApns.isEmpty() ? mnoApns : mvnoApns;
        ArrayList<ApnSetting> result;
        if (mvnoApns.isEmpty()) {
            result = mnoApns;
            mMvnoMatched = false;
        } else {
            result = mvnoApns;
            mMvnoMatched = true;
        }
        if (DBG) log("createApnList: X result=" + result);
        return result;
    }
@@ -3119,6 +3130,7 @@ public final class DcTracker extends Handler {
     * 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() : "";