From 6bfc88876ab575913299b477528225a4d7bf8232 Mon Sep 17 00:00:00 2001 From: Irfan Sheriff Date: Wed, 29 Aug 2012 15:35:57 -0700 Subject: Fix DHCP handling at disconnect/reconnect Wifi can have a quick disconnection followed by a reconnection. We used to create a new DHCP state machine thread for every new connection and never really waited until it quit after disconnect. This may have lead to situations where repeated disconnect/reconnects resulted in multiple dhcp start calls. We now keep the statemachine after a disconnect and only shut it at supplicant stop. Bug: 6417686 Change-Id: Icf66efdc654be886e3eb46c81f09f8cce536f2f6 --- services/java/com/android/server/WifiService.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'services/java/com') diff --git a/services/java/com/android/server/WifiService.java b/services/java/com/android/server/WifiService.java index 84d670e3e163..6bc5e1074120 100644 --- a/services/java/com/android/server/WifiService.java +++ b/services/java/com/android/server/WifiService.java @@ -240,7 +240,7 @@ public class WifiService extends IWifiManager.Stub { switch (msg.what) { case AsyncChannel.CMD_CHANNEL_HALF_CONNECTED: { if (msg.arg1 == AsyncChannel.STATUS_SUCCESSFUL) { - Slog.d(TAG, "New client listening to asynchronous messages"); + if (DBG) Slog.d(TAG, "New client listening to asynchronous messages"); mClients.add((AsyncChannel) msg.obj); } else { Slog.e(TAG, "Client connection failure, error=" + msg.arg1); @@ -249,9 +249,9 @@ public class WifiService extends IWifiManager.Stub { } case AsyncChannel.CMD_CHANNEL_DISCONNECTED: { if (msg.arg1 == AsyncChannel.STATUS_SEND_UNSUCCESSFUL) { - Slog.d(TAG, "Send failed, client connection lost"); + if (DBG) Slog.d(TAG, "Send failed, client connection lost"); } else { - Slog.d(TAG, "Client connection lost with reason: " + msg.arg1); + if (DBG) Slog.d(TAG, "Client connection lost with reason: " + msg.arg1); } mClients.remove((AsyncChannel) msg.obj); break; -- cgit v1.2.3-59-g8ed1b