From 34fe791453ec139086237d9ac902d9a502de0798 Mon Sep 17 00:00:00 2001 From: Irfan Sheriff Date: Wed, 28 Jul 2010 16:58:51 -0700 Subject: Handle loss of supplicant events at start If the supplicant events are lost even before connection, we stay stuck without doing IP address. The earlier implementation used polling at connection to handle this case. A disconnect after connection handles this cleanly. Bug: 2876987 Change-Id: I7509c5f332f87b91e1ff8438cf859a0e49df2e6d --- wifi/java/android/net/wifi/WifiStateTracker.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/wifi/java/android/net/wifi/WifiStateTracker.java b/wifi/java/android/net/wifi/WifiStateTracker.java index 4fb35c9..388beea 100644 --- a/wifi/java/android/net/wifi/WifiStateTracker.java +++ b/wifi/java/android/net/wifi/WifiStateTracker.java @@ -2960,6 +2960,15 @@ public class WifiStateTracker extends HierarchicalStateMachine implements Networ transitionTo(mScanModeState); } else { WifiNative.setScanResultHandlingCommand(CONNECT_MODE); + /* If supplicant has already connected, before we could finish establishing + * the control channel connection, we miss all the supplicant events. + * Disconnect and reconnect when driver has started to ensure we receive + * all supplicant events. + * + * TODO: This is a bit unclean, ideally the supplicant should never + * connect until told to do so by the framework + */ + WifiNative.disconnectCommand(); WifiNative.reconnectCommand(); transitionTo(mConnectModeState); } -- cgit v1.1