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

Commit ec8f960e authored by Dave Daynard's avatar Dave Daynard Committed by Sam Mortimer
Browse files

Allow override of DUN settings

Allow override of system DUN settings by setting
persist.sys.dun.override
to one of the following values:
2 = not set, 0 = DUN not required, 1 = DUN required
If the prop is not set the system setting will be used.

Change-Id: I296f303a23351e4ab29898895abfcd313c747db9
parent e05eaa78
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ import android.content.Context;
import android.content.res.Resources;
import android.net.ConnectivityManager;
import android.net.util.SharedLog;
import android.os.SystemProperties;
import android.telephony.TelephonyManager;
import android.text.TextUtils;

@@ -211,6 +212,11 @@ public class TetheringConfiguration {
    }

    public static int checkDunRequired(Context ctx) {
        // Allow override via prop
        final int dunProp = SystemProperties.getInt("persist.sys.dun.override", -1);
        if (dunProp >= 0) {
            return dunProp;
        }
        final TelephonyManager tm = (TelephonyManager) ctx.getSystemService(TELEPHONY_SERVICE);
        return (tm != null) ? tm.getTetherApnRequired() : DUN_UNSPECIFIED;
    }