diff options
author | Chung-yih Wang <cywang@google.com> | 2009-09-22 10:24:36 +0800 |
---|---|---|
committer | Chung-yih Wang <cywang@google.com> | 2009-09-22 12:01:15 +0800 |
commit | 7121ac5644f222763c99975bcce93c28775a6386 (patch) | |
tree | a8588682916425dc4c3815b86a8b8d7e0c869425 /wifi | |
parent | f97f436ed6e14a680cef88a5a61b0b06f847a107 (diff) | |
download | frameworks_base-7121ac5644f222763c99975bcce93c28775a6386.zip frameworks_base-7121ac5644f222763c99975bcce93c28775a6386.tar.gz frameworks_base-7121ac5644f222763c99975bcce93c28775a6386.tar.bz2 |
Fix the issue of 'Wifi framework is not aware of state change'
Problem:
Connect to AP with WEP security.
Change AP's WEP password.
Phone will quickly reassociated (less than in 5 sec) and will not restart full "reconnect".
Indication will show "connected" but it will be no network access.
Fix: (for non-static IP only)
With WEP mode, the association could be successful if we change the AP's WEP password. However,
the phone wont be able to send/recv any traffic with the old password. What we could quickly
fix here is to send the DHCP request if the network is not configured to use static IP. We
can do nothing but ping access point to see if it we are able to communicate with it.
Diffstat (limited to 'wifi')
-rw-r--r-- | wifi/java/android/net/wifi/WifiStateTracker.java | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/wifi/java/android/net/wifi/WifiStateTracker.java b/wifi/java/android/net/wifi/WifiStateTracker.java index e3d8bf4..5638480 100644 --- a/wifi/java/android/net/wifi/WifiStateTracker.java +++ b/wifi/java/android/net/wifi/WifiStateTracker.java @@ -907,6 +907,7 @@ public class WifiStateTracker extends NetworkStateTracker { } } } else if (newState == SupplicantState.DISCONNECTED) { + mHaveIpAddress = false; if (isDriverStopped() || mDisconnectExpected) { handleDisconnectedState(DetailedState.DISCONNECTED); } else { @@ -1007,20 +1008,17 @@ public class WifiStateTracker extends NetworkStateTracker { setNotificationVisible(false, 0, false, 0); boolean wasDisconnectPending = mDisconnectPending; cancelDisconnect(); - if (!TextUtils.equals(mWifiInfo.getSSID(), mLastSsid)) { - /* - * The connection is fully configured as far as link-level - * connectivity is concerned, but we may still need to obtain - * an IP address. But do this only if we are connecting to - * a different network than we were connected to previously. - */ - if (wasDisconnectPending) { - DetailedState saveState = getNetworkInfo().getDetailedState(); - handleDisconnectedState(DetailedState.DISCONNECTED); - setDetailedStateInternal(saveState); - } - configureInterface(); + /* + * The connection is fully configured as far as link-level + * connectivity is concerned, but we may still need to obtain + * an IP address. + */ + if (wasDisconnectPending) { + DetailedState saveState = getNetworkInfo().getDetailedState(); + handleDisconnectedState(DetailedState.DISCONNECTED); + setDetailedStateInternal(saveState); } + configureInterface(); mLastBssid = result.BSSID; mLastSsid = mWifiInfo.getSSID(); mLastNetworkId = result.networkId; |