diff options
author | Irfan Sheriff <isheriff@google.com> | 2010-08-16 11:36:41 -0700 |
---|---|---|
committer | Irfan Sheriff <isheriff@google.com> | 2010-08-20 14:51:00 -0700 |
commit | fae66c3ab59c741aad631e6f2dd82b77b1d4a353 (patch) | |
tree | 1e66ab5fa535448f25693755af16626f2cad5d20 /wifi | |
parent | 581f78615a9dc65ee264b3619ef6cdd0b0e8355c (diff) | |
download | frameworks_base-fae66c3ab59c741aad631e6f2dd82b77b1d4a353.zip frameworks_base-fae66c3ab59c741aad631e6f2dd82b77b1d4a353.tar.gz frameworks_base-fae66c3ab59c741aad631e6f2dd82b77b1d4a353.tar.bz2 |
DO NOT MERGE Enable all networks on screen on
Connectivity to a disabled network never happens.
An old dhcp issue for example prevents
connectivity again in future. Allow connectivity
on all networks on screen on.
Bug: 2129037
Change-Id: I42afc17ddb5cd238e46d7e50f1b6e708e107b35d
Diffstat (limited to 'wifi')
-rw-r--r-- | wifi/java/android/net/wifi/WifiStateTracker.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/wifi/java/android/net/wifi/WifiStateTracker.java b/wifi/java/android/net/wifi/WifiStateTracker.java index 0cc1f46..22dbda3 100644 --- a/wifi/java/android/net/wifi/WifiStateTracker.java +++ b/wifi/java/android/net/wifi/WifiStateTracker.java @@ -59,6 +59,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Set; import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicBoolean; /** * Track the state of Wifi connectivity. All event handling is done here, @@ -216,6 +217,9 @@ public class WifiStateTracker extends NetworkStateTracker { private boolean mUseStaticIp = false; private int mReconnectCount; + /* Tracks if any network in the configuration is disabled */ + private AtomicBoolean mIsAnyNetworkDisabled = new AtomicBoolean(false); + // used to store the (non-persisted) num determined during device boot // (from mcc or other phone info) before the driver is started. private int mNumAllowedChannels = 0; @@ -814,6 +818,7 @@ public class WifiStateTracker extends NetworkStateTracker { mTornDownByConnMgr = false; mLastBssid = null; mLastSsid = null; + mIsAnyNetworkDisabled.set(false); requestConnectionInfo(); SupplicantState supplState = mWifiInfo.getSupplicantState(); /** @@ -1585,6 +1590,10 @@ public class WifiStateTracker extends NetworkStateTracker { mWifiState.set(wifiState); } + public boolean isAnyNetworkDisabled() { + return mIsAnyNetworkDisabled.get(); + } + /** * The WifiNative interface functions are listed below. * The only native call that is not synchronized on @@ -1785,10 +1794,28 @@ public class WifiStateTracker extends NetworkStateTracker { if (mWifiState.get() != WIFI_STATE_ENABLED) { return false; } + if (disableOthers) mIsAnyNetworkDisabled.set(true); return WifiNative.enableNetworkCommand(netId, disableOthers); } /** + * Enable all networks + * + * @param networks list of configured networks + */ + public synchronized void enableAllNetworks(List<WifiConfiguration> networks) { + if (mWifiState.get() != WIFI_STATE_ENABLED) { + return; + } + mIsAnyNetworkDisabled.set(false); + for (WifiConfiguration config : networks) { + if (config.status == WifiConfiguration.Status.DISABLED) { + WifiNative.enableNetworkCommand(config.networkId, false); + } + } + } + + /** * Disable a network * * @param netId network id of the network @@ -1798,6 +1825,7 @@ public class WifiStateTracker extends NetworkStateTracker { if (mWifiState.get() != WIFI_STATE_ENABLED) { return false; } + mIsAnyNetworkDisabled.set(true); return WifiNative.disableNetworkCommand(netId); } |