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

Commit 0badd0b7 authored by Robert Greenwalt's avatar Robert Greenwalt
Browse files

Note net availability even when apn not enabled

Fixes a problem where mms apn was on when we lost the network (airplane mode) but mms was
off when airplane mode was turned off so it kept thinking we didn't have access and
future mms always failed.

bug: 2075145
parent 4a51c20c
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -147,7 +147,10 @@ public class MobileDataStateTracker extends NetworkStateTracker {
                            ", unavailable = " + unavailable + ", reason = " +
                            (reason == null ? "(unspecified)" : reason));


                    if (isApnTypeIncluded(apnTypeList)) {
                        // set this even if the apn isn't Enabled
                        mNetworkInfo.setIsAvailable(!unavailable);
                        if (mEnabled == false) {
                            // if we're not enabled but the APN Type is supported by this connection
                            // we should record the interface name if one's provided.  If the user
@@ -168,7 +171,6 @@ public class MobileDataStateTracker extends NetworkStateTracker {
                        return;
                    }

                    mNetworkInfo.setIsAvailable(!unavailable);
                    if (mMobileDataState != state) {
                        mMobileDataState = state;
                        switch (state) {
+2 −1
Original line number Diff line number Diff line
@@ -453,7 +453,8 @@ public abstract class DataConnectionTracker extends Handler {
    }

    protected synchronized void setEnabled(int id, boolean enable) {
        if (DBG) Log.d(LOG_TAG, "setEnabled(" + id + ", " + enable + ')');
        if (DBG) Log.d(LOG_TAG, "setEnabled(" + id + ", " + enable + ") with old state = " +
                dataEnabled[id] + " and enabledCount = " + enabledCount);
        if (dataEnabled[id] != enable) {
            dataEnabled[id] = enable;