summaryrefslogtreecommitdiffstats
path: root/wifi
diff options
context:
space:
mode:
authorIrfan Sheriff <isheriff@google.com>2010-08-21 11:53:08 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-08-21 11:53:08 -0700
commitb65444df013020000a0d60491e9cf14c950c9500 (patch)
tree7c3ce523545a97507e03667c0b820fe38b078887 /wifi
parent6d895fdbc023743f3870042e73a5614764e4165b (diff)
parent80db4381c010c4dec74c2bf1e02380759e4ff97b (diff)
downloadframeworks_base-b65444df013020000a0d60491e9cf14c950c9500.zip
frameworks_base-b65444df013020000a0d60491e9cf14c950c9500.tar.gz
frameworks_base-b65444df013020000a0d60491e9cf14c950c9500.tar.bz2
am 80db4381: Merge "DO NOT MERGE Enable all networks on screen on" into gingerbread
Merge commit '80db4381c010c4dec74c2bf1e02380759e4ff97b' into gingerbread-plus-aosp * commit '80db4381c010c4dec74c2bf1e02380759e4ff97b': DO NOT MERGE Enable all networks on screen on
Diffstat (limited to 'wifi')
-rw-r--r--wifi/java/android/net/wifi/WifiStateTracker.java28
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 cdf154f..59f2312 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;
@@ -815,6 +819,7 @@ public class WifiStateTracker extends NetworkStateTracker {
mTornDownByConnMgr = false;
mLastBssid = null;
mLastSsid = null;
+ mIsAnyNetworkDisabled.set(false);
requestConnectionInfo();
SupplicantState supplState = mWifiInfo.getSupplicantState();
/**
@@ -1586,6 +1591,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
@@ -1786,10 +1795,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
@@ -1799,6 +1826,7 @@ public class WifiStateTracker extends NetworkStateTracker {
if (mWifiState.get() != WIFI_STATE_ENABLED) {
return false;
}
+ mIsAnyNetworkDisabled.set(true);
return WifiNative.disableNetworkCommand(netId);
}