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

Commit 4efe58d8 authored by Robert Greenwalt's avatar Robert Greenwalt
Browse files

Temp disable Tethering if DUN is required

Getting source-based routing working is too risk for this point
in the project but tethering is broken otherwise, so disable
the tethering option if DUN is required until we can get a real
fix in.

bug:5495862
Change-Id: I5e852bf30c887599024a8b61af86ffec1d5333af
parent 8d059ac5
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2450,6 +2450,12 @@ public class ConnectivityService extends IConnectivityManager.Stub {
        int defaultVal = (SystemProperties.get("ro.tether.denied").equals("true") ? 0 : 1);
        boolean tetherEnabledInSettings = (Settings.Secure.getInt(mContext.getContentResolver(),
                Settings.Secure.TETHER_SUPPORTED, defaultVal) != 0);
        // Short term disabling of Tethering if DUN is required.
        // TODO - fix multi-connection tethering using policy-base routing
        int[] upstreamConnTypes = mTethering.getUpstreamIfaceTypes();
        for (int i : upstreamConnTypes) {
            if (i == ConnectivityManager.TYPE_MOBILE_DUN) return false;
        }
        return tetherEnabledInSettings && mTetheringConfigValid;
    }