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

Commit c0303921 authored by Jaikumar Ganesh's avatar Jaikumar Ganesh
Browse files

Fix setting of the APN type.

The user is on wifi, then enables SUPL APN. When wifi is switched off,
we try to establish DATA connection on the Default APN. If this fails,
we were not retrying as the mRequestedApnType variable was not being reset.
This was happening because the SUPL APN and the data connection APN
were the same.
parent bd9aa793
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -377,10 +377,14 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
            removeMessages(EVENT_RESTORE_DEFAULT_APN);
            setEnabled(type, false);
            if (isApnTypeActive(Phone.APN_TYPE_DEFAULT)) {
                mRequestedApnType = Phone.APN_TYPE_DEFAULT;
                if (dataEnabled[APN_DEFAULT_ID]) {
                    return Phone.APN_ALREADY_ACTIVE;
                } else {
                    cleanUpConnection(true, Phone.REASON_DATA_DISABLED);
                    Message msg = obtainMessage(EVENT_CLEAN_UP_CONNECTION);
                    msg.arg1 = 1; // tearDown is true;
                    msg.obj = Phone.REASON_DATA_DISABLED;
                    sendMessage(msg);
                    return Phone.APN_REQUEST_STARTED;
                }
            } else {
@@ -1235,10 +1239,9 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
    protected void onRestoreDefaultApn() {
        if (DBG) Log.d(LOG_TAG, "Restore default APN");
        setEnabled(Phone.APN_TYPE_MMS, false);

        mRequestedApnType = Phone.APN_TYPE_DEFAULT;
        if (!isApnTypeActive(Phone.APN_TYPE_DEFAULT)) {
            cleanUpConnection(true, Phone.REASON_RESTORE_DEFAULT_APN);
            mRequestedApnType = Phone.APN_TYPE_DEFAULT;
        }
    }