summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Daynard <nardholio@gmail.com>2013-12-15 15:35:04 -0500
committerSam Mortimer <sam@mortimer.me.uk>2019-08-29 23:41:41 -0700
commitec8f960e6391d5aa6d5834f622c6e4ddd49ee8fb (patch)
tree10948b06af9cfb5733ec469d2560326522a35ef9
parente05eaa78818630b0e21837f30c26406c28973fa8 (diff)
downloadframeworks_base-ec8f960e6391d5aa6d5834f622c6e4ddd49ee8fb.tar.gz
frameworks_base-ec8f960e6391d5aa6d5834f622c6e4ddd49ee8fb.tar.bz2
frameworks_base-ec8f960e6391d5aa6d5834f622c6e4ddd49ee8fb.zip
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
-rw-r--r--services/core/java/com/android/server/connectivity/tethering/TetheringConfiguration.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/connectivity/tethering/TetheringConfiguration.java b/services/core/java/com/android/server/connectivity/tethering/TetheringConfiguration.java
index dd9fe05b50f..b6b429653c3 100644
--- a/services/core/java/com/android/server/connectivity/tethering/TetheringConfiguration.java
+++ b/services/core/java/com/android/server/connectivity/tethering/TetheringConfiguration.java
@@ -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;
}