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

Commit 495056ab authored by Robert Greenwalt's avatar Robert Greenwalt Committed by Android (Google) Code Review
Browse files

Merge "Turn off DUN connection after tethering." into honeycomb

parents b439221a 19b9ab46
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -849,7 +849,8 @@ public class ConnectivityService extends IConnectivityManager.Stub {
                    usedNetworkType = ConnectivityManager.TYPE_MOBILE_MMS;
                } else if (TextUtils.equals(feature, Phone.FEATURE_ENABLE_SUPL)) {
                    usedNetworkType = ConnectivityManager.TYPE_MOBILE_SUPL;
                } else if (TextUtils.equals(feature, Phone.FEATURE_ENABLE_DUN)) {
                } else if (TextUtils.equals(feature, Phone.FEATURE_ENABLE_DUN) ||
                        TextUtils.equals(feature, Phone.FEATURE_ENABLE_DUN_ALWAYS)) {
                    usedNetworkType = ConnectivityManager.TYPE_MOBILE_DUN;
                } else if (TextUtils.equals(feature, Phone.FEATURE_ENABLE_HIPRI)) {
                    usedNetworkType = ConnectivityManager.TYPE_MOBILE_HIPRI;
@@ -870,6 +871,8 @@ public class ConnectivityService extends IConnectivityManager.Stub {
                    return 1;
                }
                callTeardown = true;
            } else {
                if (DBG) log("not a known feature - dropping");
            }
        }
        if (DBG) log("Doing network teardown");
+4 −3
Original line number Diff line number Diff line
@@ -1165,7 +1165,7 @@ public class Tethering extends INetworkManagementEventObserver.Stub {
                            IConnectivityManager.Stub.asInterface(b);
                    try {
                        service.stopUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE,
                                (mDunRequired? Phone.FEATURE_ENABLE_DUN :
                                (mDunRequired? Phone.FEATURE_ENABLE_DUN_ALWAYS :
                                             Phone.FEATURE_ENABLE_HIPRI));
                    } catch (Exception e) {
                        return false;
@@ -1354,10 +1354,11 @@ public class Tethering extends INetworkManagementEventObserver.Stub {
        }

        class TetherModeAliveState extends TetherMasterUtilState {
            boolean mTryCell = WAIT_FOR_NETWORK_TO_SETTLE;
            boolean mTryCell = !WAIT_FOR_NETWORK_TO_SETTLE;
            @Override
            public void enter() {
                mTryCell = WAIT_FOR_NETWORK_TO_SETTLE;  // first pass lets just see what we have.
                mTryCell = !WAIT_FOR_NETWORK_TO_SETTLE; // better try something first pass
                                                        // or crazy tests cases will fail
                chooseUpstreamType(mTryCell);
                mTryCell = !mTryCell;
                turnOnMasterTetherSettings(); // may transition us out
+1 −1
Original line number Diff line number Diff line
@@ -358,7 +358,7 @@ public abstract class DataConnectionTracker extends Handler {
        return new ArrayList<DataConnection>(mDataConnections.values());
    }

    protected boolean isApnTypeActive(String type) {
    public boolean isApnTypeActive(String type) {
        // TODO: support simultaneous with List instead
        return mActiveApn != null && mActiveApn.canHandleType(type);
    }
+2 −1
Original line number Diff line number Diff line
@@ -610,7 +610,8 @@ public class CDMAPhone extends PhoneBase {
            // If we're out of service, open TCP sockets may still work
            // but no data will flow
            ret = DataState.DISCONNECTED;
        } else if (mDataConnection.isApnTypeEnabled(apnType) == false) {
        } else if (mDataConnection.isApnTypeEnabled(apnType) == false ||
                mDataConnection.isApnTypeActive(apnType) == false) {
            ret = DataState.DISCONNECTED;
        } else {
            switch (mDataConnection.getState()) {
+2 −1
Original line number Diff line number Diff line
@@ -300,7 +300,8 @@ public class GSMPhone extends PhoneBase {
            // If we're out of service, open TCP sockets may still work
            // but no data will flow
            ret = DataState.DISCONNECTED;
        } else if (mDataConnection.isApnTypeEnabled(apnType) == false) {
        } else if (mDataConnection.isApnTypeEnabled(apnType) == false ||
                mDataConnection.isApnTypeActive(apnType) == false) {
            ret = DataState.DISCONNECTED;
        } else { /* mSST.gprsState == ServiceState.STATE_IN_SERVICE */
            switch (mDataConnection.getState()) {