summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/connectivity/Tethering.java
diff options
context:
space:
mode:
authorRobert Greenwalt <rgreenwalt@google.com>2012-02-28 12:25:34 -0800
committerRobert Greenwalt <rgreenwalt@google.com>2012-02-29 14:02:55 -0800
commitc9dac1185d6944e4bdb851a06ae07ea3621042bf (patch)
treede4eb222bd5f8d4a79f626f7b2b8056480229fd8 /services/java/com/android/server/connectivity/Tethering.java
parentd9f94416fcca8bd091075d1058eade91811b798f (diff)
Don't forget to turn off mobile_dun
When we find a higher priority match for tethering traffic we should turn off whatever we were trying before. bug:6083611 Change-Id: I06ee41336df107353bf1a979150345e461574a48
Diffstat (limited to 'services/java/com/android/server/connectivity/Tethering.java')
-rw-r--r--services/java/com/android/server/connectivity/Tethering.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/services/java/com/android/server/connectivity/Tethering.java b/services/java/com/android/server/connectivity/Tethering.java
index 9573fda5c2ed..88a0ccbe702d 100644
--- a/services/java/com/android/server/connectivity/Tethering.java
+++ b/services/java/com/android/server/connectivity/Tethering.java
@@ -1215,6 +1215,8 @@ public class Tethering extends INetworkManagementEventObserver.Stub {
return retValue;
}
protected boolean turnOffUpstreamMobileConnection() {
+ // ignore pending renewal requests
+ ++mCurrentConnectionSequence;
if (mMobileApnReserved != ConnectivityManager.TYPE_NONE) {
try {
mConnService.stopUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE,
@@ -1304,6 +1306,14 @@ public class Tethering extends INetworkManagementEventObserver.Stub {
if (upType == ConnectivityManager.TYPE_MOBILE_DUN ||
upType == ConnectivityManager.TYPE_MOBILE_HIPRI) {
turnOnUpstreamMobileConnection(upType);
+ } else if (upType != ConnectivityManager.TYPE_NONE) {
+ /* If we've found an active upstream connection that's not DUN/HIPRI
+ * we should stop any outstanding DUN/HIPRI start requests.
+ *
+ * If we found NONE we don't want to do this as we want any previous
+ * requests to keep trying to bring up something we can use.
+ */
+ turnOffUpstreamMobileConnection();
}
if (upType == ConnectivityManager.TYPE_NONE) {