Merge change 24805 into eclair

* changes:
  Don't init wifiChannels until after supplicant up
diff --git a/services/java/com/android/server/WifiService.java b/services/java/com/android/server/WifiService.java
index 6e6f66f..53ff78e 100644
--- a/services/java/com/android/server/WifiService.java
+++ b/services/java/com/android/server/WifiService.java
@@ -374,13 +374,6 @@
         }
         setWifiEnabledState(eventualWifiState, uid);
 
-        /*
-         * Initialize the number of allowed radio channels if Wi-Fi is being turned on.
-         */
-        if (enable) {
-            mWifiStateTracker.setNumAllowedChannels();
-        }
-
         return true;
     }
 
diff --git a/wifi/java/android/net/wifi/WifiStateTracker.java b/wifi/java/android/net/wifi/WifiStateTracker.java
index fa24a98..9a11404 100644
--- a/wifi/java/android/net/wifi/WifiStateTracker.java
+++ b/wifi/java/android/net/wifi/WifiStateTracker.java
@@ -784,6 +784,9 @@
                     mBluetoothA2dp = new BluetoothA2dp(mContext);
                 }
                 checkIsBluetoothPlaying();
+
+                // initialize this after the supplicant is alive
+                setNumAllowedChannels();
                 break;
 
             case EVENT_SUPPLICANT_DISCONNECT: