Don't init wifiChannels until after supplicant up

The supplicant can take up to 15 seconds to start - setting the number of wifi channels
immediately after requested wifi start often will fail.

Changed to set the number of channels when the supplicant is reported as alive.

bug:2083601
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: