summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorRobert Greenwalt <rgreenwalt@google.com>2010-12-29 14:35:21 -0800
committerRobert Greenwalt <rgreenwalt@google.com>2011-01-04 11:15:19 -0800
commite32e812b11520b244374371ee49eaed20c84a6e3 (patch)
tree8c4521331196614a50376cfe1f0f03fcc09d0c69 /services
parent08a4186b1f0ca71aac94a24c1dbbdc0a84b8c705 (diff)
downloadframeworks_base-e32e812b11520b244374371ee49eaed20c84a6e3.zip
frameworks_base-e32e812b11520b244374371ee49eaed20c84a6e3.tar.gz
frameworks_base-e32e812b11520b244374371ee49eaed20c84a6e3.tar.bz2
Always file DUN requests for tethering.
A bit of a hack so that first trySetupData call uses the proper APN in strange edge cases. Made a new startUsingNetworkFeature string that ConnectivityService knows means always pass the request to telephony even if telephony connections are not currently available. bug:3133178 Change-Id: I2559b9cbaed4b4ec02bdf7ea78e6003ee2be64f2
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/ConnectivityService.java9
-rw-r--r--services/java/com/android/server/connectivity/Tethering.java4
2 files changed, 9 insertions, 4 deletions
diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java
index 5eb42e7..eeaeadc 100644
--- a/services/java/com/android/server/ConnectivityService.java
+++ b/services/java/com/android/server/ConnectivityService.java
@@ -697,7 +697,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;
@@ -712,7 +713,11 @@ public class ConnectivityService extends IConnectivityManager.Stub {
if (ni.isAvailable() == false) {
if (DBG) log("special network not available");
- return Phone.APN_TYPE_NOT_AVAILABLE;
+ if (!TextUtils.equals(feature,Phone.FEATURE_ENABLE_DUN_ALWAYS)) {
+ return Phone.APN_TYPE_NOT_AVAILABLE;
+ } else {
+ // else make the attempt anyway - probably giving REQUEST_STARTED below
+ }
}
synchronized(this) {
diff --git a/services/java/com/android/server/connectivity/Tethering.java b/services/java/com/android/server/connectivity/Tethering.java
index a562e1f..fc1b2c4 100644
--- a/services/java/com/android/server/connectivity/Tethering.java
+++ b/services/java/com/android/server/connectivity/Tethering.java
@@ -1138,8 +1138,8 @@ public class Tethering extends INetworkManagementEventObserver.Stub {
int result = Phone.APN_REQUEST_FAILED;
try {
result = service.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE,
- (mDunRequired ? Phone.FEATURE_ENABLE_DUN : Phone.FEATURE_ENABLE_HIPRI),
- new Binder());
+ (mDunRequired ? Phone.FEATURE_ENABLE_DUN_ALWAYS :
+ Phone.FEATURE_ENABLE_HIPRI), new Binder());
} catch (Exception e) {
}
switch (result) {