summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/ConnectivityService.java
diff options
context:
space:
mode:
authorRobert Greenwalt <robdroid@android.com>2010-02-25 12:04:29 -0800
committerRobert Greenwalt <robdroid@android.com>2010-02-25 12:04:29 -0800
commit35429599728793a6830a8ce32a62e98cabefc90e (patch)
tree5b3eb5d30207bf7eb356490bf6452f8e4f516942 /services/java/com/android/server/ConnectivityService.java
parente46145f7c114b9ac6d19c6a7886e9239463f91e1 (diff)
Fix no-mobile-data after wifi.
Missed a case - if you disabled mobile data and then cycled wifi, 3g would be turned back on. bug:2251458
Diffstat (limited to 'services/java/com/android/server/ConnectivityService.java')
-rw-r--r--services/java/com/android/server/ConnectivityService.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java
index df685abc17ae..19f4b8ae1f74 100644
--- a/services/java/com/android/server/ConnectivityService.java
+++ b/services/java/com/android/server/ConnectivityService.java
@@ -934,9 +934,18 @@ public class ConnectivityService extends IConnectivityManager.Stub {
int newType = -1;
int newPriority = -1;
+ boolean noMobileData = !getMobileDataEnabled();
for (int checkType=0; checkType <= ConnectivityManager.MAX_NETWORK_TYPE; checkType++) {
if (checkType == prevNetType) continue;
if (mNetAttributes[checkType] == null) continue;
+ if (mNetAttributes[checkType].mRadio == ConnectivityManager.TYPE_MOBILE &&
+ noMobileData) {
+ if (DBG) {
+ Log.d(TAG, "not failing over to mobile type " + checkType +
+ " because Mobile Data Disabled");
+ }
+ continue;
+ }
if (mNetAttributes[checkType].isDefault()) {
/* TODO - if we have multiple nets we could use
* we may want to put more thought into which we choose