merge in gingerbread-release history after reset to gingerbread
diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java
index 6694dbe..8c4bf18 100644
--- a/services/java/com/android/server/ConnectivityService.java
+++ b/services/java/com/android/server/ConnectivityService.java
@@ -391,6 +391,10 @@
                     nst.startMonitoring();
                 }
                 mNetTrackers[netType] = nst;
+                if (noMobileData) {
+                    if (DBG) Slog.d(TAG, "tearing down WiMAX networks due to setting");
+                    mNetTrackers[netType].teardown();
+                }
                 break;
             default:
                 Slog.e(TAG, "Trying to create a DataStateTracker for an unknown radio type " +
@@ -987,6 +991,12 @@
                 }
                 mNetTrackers[ConnectivityManager.TYPE_MOBILE].reconnect();
             }
+            if (mNetTrackers[ConnectivityManager.TYPE_WIMAX] != null) {
+                if (DBG) {
+                    Slog.d(TAG, "starting up " + mNetTrackers[ConnectivityManager.TYPE_WIMAX]);
+                }
+                mNetTrackers[ConnectivityManager.TYPE_WIMAX].reconnect();
+            }
         } else {
             for (NetworkStateTracker nt : mNetTrackers) {
                 if (nt == null) continue;
@@ -996,6 +1006,9 @@
                     nt.teardown();
                 }
             }
+            if (mNetTrackers[ConnectivityManager.TYPE_WIMAX] != null) {
+                mNetTrackers[ConnectivityManager.TYPE_WIMAX].teardown();
+            }
         }
     }
 
@@ -1124,6 +1137,12 @@
                             " because Mobile Data Disabled");
                     continue;
                 }
+                if (mNetAttributes[checkType].mRadio == ConnectivityManager.TYPE_WIMAX &&
+                        noMobileData) {
+                    Slog.e(TAG, "not failing over to mobile type " + checkType +
+                            " because Mobile Data Disabled");
+                    continue;
+                }
                 NetworkStateTracker checkTracker = mNetTrackers[checkType];
                 NetworkInfo checkInfo = checkTracker.getNetworkInfo();
                 if (!checkInfo.isConnectedOrConnecting() || checkTracker.isTeardownRequested()) {
@@ -1266,6 +1285,7 @@
                             " teardown");
                     if (!teardown(otherNet)) {
                         Slog.e(TAG, "Network declined teardown request");
+                        teardown(thisNet);
                         return;
                     }
                     if (isFailover) {