Add wifi "HANGED" driver state triggering reload.

The driver can now report to us that they are hosed and we'll shut
down wifi and restart it - only to be used as a last resort.

Also fixing synch problem with updateWifiState.

bug: 2173119
This commit is contained in:
Robert Greenwalt
2009-10-22 17:03:47 -07:00
parent 9069aa31ac
commit f75aa36fc8
3 changed files with 47 additions and 12 deletions

View File

@@ -142,6 +142,7 @@ public class WifiService extends IWifiManager.Stub {
private static final int MESSAGE_STOP_WIFI = 2;
private static final int MESSAGE_START_WIFI = 3;
private static final int MESSAGE_RELEASE_WAKELOCK = 4;
private static final int MESSAGE_UPDATE_STATE = 5;
private final WifiHandler mWifiHandler;
@@ -1446,6 +1447,11 @@ public class WifiService extends IWifiManager.Stub {
}
private void updateWifiState() {
// send a message so it's all serialized
Message.obtain(mWifiHandler, MESSAGE_UPDATE_STATE, 0, 0).sendToTarget();
}
private void doUpdateWifiState() {
boolean wifiEnabled = getPersistedWifiEnabled();
boolean airplaneMode = isAirplaneModeOn() && !mAirplaneModeOverwridden;
boolean lockHeld = mLocks.hasLocks();
@@ -1551,6 +1557,10 @@ public class WifiService extends IWifiManager.Stub {
sWakeLock.release();
break;
case MESSAGE_UPDATE_STATE:
doUpdateWifiState();
break;
case MESSAGE_DISABLE_WIFI:
// a non-zero msg.arg1 value means the "enabled" setting
// should be persisted