summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIrfan Sheriff <isheriff@google.com>2010-07-28 16:58:51 -0700
committerIrfan Sheriff <isheriff@google.com>2010-07-28 17:40:20 -0700
commit34fe791453ec139086237d9ac902d9a502de0798 (patch)
treefa1eff859a7f924a31690cf6084395ba511558ae
parentf54a8d7c479485174941c38f151ea7083c658da3 (diff)
downloadframeworks_base-34fe791453ec139086237d9ac902d9a502de0798.zip
frameworks_base-34fe791453ec139086237d9ac902d9a502de0798.tar.gz
frameworks_base-34fe791453ec139086237d9ac902d9a502de0798.tar.bz2
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
-rw-r--r--wifi/java/android/net/wifi/WifiStateTracker.java9
1 files changed, 9 insertions, 0 deletions
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);
}