From 7c9bf7caa2936e8b76598be9fffea980d81c61d3 Mon Sep 17 00:00:00 2001 From: Robert Greenwalt Date: Fri, 11 Sep 2009 17:23:35 -0700 Subject: [PATCH] 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 --- services/java/com/android/server/WifiService.java | 7 ------- wifi/java/android/net/wifi/WifiStateTracker.java | 3 +++ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/services/java/com/android/server/WifiService.java b/services/java/com/android/server/WifiService.java index 6e6f66fbdc5e7..53ff78e6160bc 100644 --- a/services/java/com/android/server/WifiService.java +++ b/services/java/com/android/server/WifiService.java @@ -374,13 +374,6 @@ public class WifiService extends IWifiManager.Stub { } 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 fa24a98320d5e..9a1140487ef7d 100644 --- a/wifi/java/android/net/wifi/WifiStateTracker.java +++ b/wifi/java/android/net/wifi/WifiStateTracker.java @@ -784,6 +784,9 @@ public class WifiStateTracker extends NetworkStateTracker { mBluetoothA2dp = new BluetoothA2dp(mContext); } checkIsBluetoothPlaying(); + + // initialize this after the supplicant is alive + setNumAllowedChannels(); break; case EVENT_SUPPLICANT_DISCONNECT: