diff options
author | Junda Liu <junda@google.com> | 2014-10-28 13:52:51 -0700 |
---|---|---|
committer | Junda Liu <junda@google.com> | 2014-11-21 16:21:30 -0800 |
commit | 38531581fc19f9172fabe56047b326e5dab88625 (patch) | |
tree | 6fb9f7a442aebcc4c91407fb3269efa3c80342d4 /services/core/java/com/android/server/connectivity/Tethering.java | |
parent | e9f7e65c4090d7ea97bc065f6fefd58c2fcebd47 (diff) | |
download | frameworks_base-38531581fc19f9172fabe56047b326e5dab88625.zip frameworks_base-38531581fc19f9172fabe56047b326e5dab88625.tar.gz frameworks_base-38531581fc19f9172fabe56047b326e5dab88625.tar.bz2 |
Add hasMatchedTetherApnSetting to telmgr API.
Bug: b/18158411
Change-Id: Id1285b79194ad21fb728fd18fb09026e51354656
Diffstat (limited to 'services/core/java/com/android/server/connectivity/Tethering.java')
-rw-r--r-- | services/core/java/com/android/server/connectivity/Tethering.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/connectivity/Tethering.java b/services/core/java/com/android/server/connectivity/Tethering.java index 7c303ff..2c8e1dc 100644 --- a/services/core/java/com/android/server/connectivity/Tethering.java +++ b/services/core/java/com/android/server/connectivity/Tethering.java @@ -42,6 +42,7 @@ import android.os.Message; import android.os.RemoteException; import android.os.UserHandle; import android.provider.Settings; +import android.telephony.TelephonyManager; import android.util.Log; import com.android.internal.telephony.Phone; @@ -630,8 +631,11 @@ public class Tethering extends BaseNetworkObserver { } public void checkDunRequired() { - int secureSetting = Settings.Global.getInt(mContext.getContentResolver(), - Settings.Global.TETHER_DUN_REQUIRED, 2); + int secureSetting = 2; + TelephonyManager tm = (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE); + if (tm != null) { + secureSetting = tm.getTetherApnRequired(); + } synchronized (mPublicSync) { // 2 = not set, 0 = DUN not required, 1 = DUN required if (secureSetting != 2) { |