Merge change 26328 into eclair

* changes:
  Fix the issue of 'Wifi framework is not aware of state change'
This commit is contained in:
Android (Google) Code Review
2009-09-22 02:02:04 -04:00

View File

@@ -907,6 +907,7 @@ public class WifiStateTracker extends NetworkStateTracker {
} }
} }
} else if (newState == SupplicantState.DISCONNECTED) { } else if (newState == SupplicantState.DISCONNECTED) {
mHaveIpAddress = false;
if (isDriverStopped() || mDisconnectExpected) { if (isDriverStopped() || mDisconnectExpected) {
handleDisconnectedState(DetailedState.DISCONNECTED); handleDisconnectedState(DetailedState.DISCONNECTED);
} else { } else {
@@ -1007,12 +1008,10 @@ public class WifiStateTracker extends NetworkStateTracker {
setNotificationVisible(false, 0, false, 0); setNotificationVisible(false, 0, false, 0);
boolean wasDisconnectPending = mDisconnectPending; boolean wasDisconnectPending = mDisconnectPending;
cancelDisconnect(); cancelDisconnect();
if (!TextUtils.equals(mWifiInfo.getSSID(), mLastSsid)) {
/* /*
* The connection is fully configured as far as link-level * The connection is fully configured as far as link-level
* connectivity is concerned, but we may still need to obtain * connectivity is concerned, but we may still need to obtain
* an IP address. But do this only if we are connecting to * an IP address.
* a different network than we were connected to previously.
*/ */
if (wasDisconnectPending) { if (wasDisconnectPending) {
DetailedState saveState = getNetworkInfo().getDetailedState(); DetailedState saveState = getNetworkInfo().getDetailedState();
@@ -1020,7 +1019,6 @@ public class WifiStateTracker extends NetworkStateTracker {
setDetailedStateInternal(saveState); setDetailedStateInternal(saveState);
} }
configureInterface(); configureInterface();
}
mLastBssid = result.BSSID; mLastBssid = result.BSSID;
mLastSsid = mWifiInfo.getSSID(); mLastSsid = mWifiInfo.getSSID();
mLastNetworkId = result.networkId; mLastNetworkId = result.networkId;