Merge "fix start driver for corner cases DO NOT MERGE" into gingerbread

This commit is contained in:
Irfan Sheriff
2010-10-12 14:55:52 -07:00
committed by Android (Google) Code Review

View File

@@ -1285,15 +1285,13 @@ public class WifiStateTracker extends NetworkStateTracker {
if (macaddr != null) { if (macaddr != null) {
mWifiInfo.setMacAddress(macaddr); mWifiInfo.setMacAddress(macaddr);
} }
if (mRunState == RUN_STATE_STARTING) { mRunState = RUN_STATE_RUNNING;
mRunState = RUN_STATE_RUNNING; if (!mIsScanOnly) {
if (!mIsScanOnly) { reconnectCommand();
reconnectCommand(); } else {
} else { // In some situations, supplicant needs to be kickstarted to
// In some situations, supplicant needs to be kickstarted to // start the background scanning
// start the background scanning scan(true);
scan(true);
}
} }
} }
break; break;
@@ -1613,12 +1611,10 @@ public class WifiStateTracker extends NetworkStateTracker {
} }
public synchronized boolean restart() { public synchronized boolean restart() {
if (mRunState == RUN_STATE_STOPPED) { if (isDriverStopped()) {
mRunState = RUN_STATE_STARTING; mRunState = RUN_STATE_STARTING;
resetConnections(true); resetConnections(true);
return startDriver(); return startDriver();
} else if (mRunState == RUN_STATE_STOPPING) {
mRunState = RUN_STATE_STARTING;
} }
return true; return true;
} }