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

Commit ec9fe467 authored by Robert Greenwalt's avatar Robert Greenwalt
Browse files

Fix a race condition for data change notification

We could sometimes not be told about network state changes breaking subsequent mms access.
Turning on more logging too.

bug: 2069106
parent 2e951b55
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -320,6 +320,7 @@ public class MobileDataStateTracker extends NetworkStateTracker {
                mEnabled = true;
                // need to set self to CONNECTING so the below message is handled.
                mMobileDataState = Phone.DataState.CONNECTING;
                setDetailedState(DetailedState.CONNECTING, Phone.REASON_APN_CHANGED, null);
                //send out a connected message
                Intent intent = new Intent(TelephonyIntents.
                        ACTION_ANY_DATA_CONNECTION_STATE_CHANGED);
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ public abstract class NetworkStateTracker extends Handler {
    private boolean mDefaultRouteSet;
    private boolean mTeardownRequested;

    private static boolean DBG = Config.LOGV;
    private static boolean DBG = true;
    private static final String TAG = "NetworkStateTracker";

    public static final int EVENT_STATE_CHANGED = 1;
+9 −0
Original line number Diff line number Diff line
@@ -357,6 +357,11 @@ public class ConnectivityService extends IConnectivityManager.Stub {
        for (int t=0; t <= ConnectivityManager.MAX_RADIO_TYPE; t++) {
            if (t != mNetworkPreference &&
                    mNetTrackers[t].getNetworkInfo().isConnected()) {
                if (DBG) {
                    Log.d(TAG, "tearing down " +
                            mNetTrackers[t].getNetworkInfo() +
                            " in enforcePreference");
                }
                teardown(mNetTrackers[t]);
            }
        }
@@ -1232,6 +1237,10 @@ public class ConnectivityService extends IConnectivityManager.Stub {
                        NetworkInfo i = net.getNetworkInfo();
                        if (i.isConnected() &&
                                !mNetAttributes[i.getType()].isDefault()) {
                            if (DBG) {
                                Log.d(TAG, "tearing down " + i +
                                        " to restore the default network");
                            }
                            teardown(net);
                        }
                    }