am 2e2f6b5e: Merge change 26328 into eclair

Merge commit '2e2f6b5e6866cdba632bdd599cadbf235b80546f' into eclair-plus-aosp

* commit '2e2f6b5e6866cdba632bdd599cadbf235b80546f':
  Fix the issue of 'Wifi framework is not aware of state change'
This commit is contained in:
Chung-yih Wang
2009-09-21 23:09:48 -07:00
committed by Android Git Automerger

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,20 +1008,17 @@ 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.
* 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();
if (wasDisconnectPending) { handleDisconnectedState(DetailedState.DISCONNECTED);
DetailedState saveState = getNetworkInfo().getDetailedState(); setDetailedStateInternal(saveState);
handleDisconnectedState(DetailedState.DISCONNECTED);
setDetailedStateInternal(saveState);
}
configureInterface();
} }
configureInterface();
mLastBssid = result.BSSID; mLastBssid = result.BSSID;
mLastSsid = mWifiInfo.getSSID(); mLastSsid = mWifiInfo.getSSID();
mLastNetworkId = result.networkId; mLastNetworkId = result.networkId;