diff options
author | Robert Greenwalt <rgreenwalt@google.com> | 2011-03-25 13:09:25 -0700 |
---|---|---|
committer | Robert Greenwalt <rgreenwalt@google.com> | 2011-04-07 12:28:37 -0700 |
commit | d55a6b498d66d8fc415908ecf63e50f46cce67e8 (patch) | |
tree | ec2e4ae98a07b51328f585c84c2696a320790bd2 /wifi/java/android | |
parent | f0d2c1c4eb613130e34a4f377d8f82f935170873 (diff) | |
download | frameworks_base-d55a6b498d66d8fc415908ecf63e50f46cce67e8.zip frameworks_base-d55a6b498d66d8fc415908ecf63e50f46cce67e8.tar.gz frameworks_base-d55a6b498d66d8fc415908ecf63e50f46cce67e8.tar.bz2 |
Add external dependency API.
An APN will not be connected to if some external dependency is not met.
bug:3486704
Change-Id: I7d94df343b260013efd11faa978deb13f07f1389
Diffstat (limited to 'wifi/java/android')
-rw-r--r-- | wifi/java/android/net/wifi/WifiStateTracker.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/wifi/java/android/net/wifi/WifiStateTracker.java b/wifi/java/android/net/wifi/WifiStateTracker.java index 07900ae..338cb4d 100644 --- a/wifi/java/android/net/wifi/WifiStateTracker.java +++ b/wifi/java/android/net/wifi/WifiStateTracker.java @@ -50,6 +50,7 @@ public class WifiStateTracker implements NetworkStateTracker { private LinkProperties mLinkProperties; private LinkCapabilities mLinkCapabilities; private NetworkInfo mNetworkInfo; + private NetworkInfo.State mLastState = NetworkInfo.State.UNKNOWN; /* For sending events to connectivity service handler */ private Handler mCsHandler; @@ -217,6 +218,14 @@ public class WifiStateTracker implements NetworkStateTracker { if (mLinkCapabilities == null) { mLinkCapabilities = new LinkCapabilities(); } + // don't want to send redundent state messages + // TODO can this be fixed in WifiStateMachine? + NetworkInfo.State state = mNetworkInfo.getState(); + if (mLastState == state) { + return; + } else { + mLastState = state; + } Message msg = mCsHandler.obtainMessage(EVENT_STATE_CHANGED, mNetworkInfo); msg.sendToTarget(); } else if (intent.getAction().equals(WifiManager.LINK_CONFIGURATION_CHANGED_ACTION)) { @@ -228,4 +237,7 @@ public class WifiStateTracker implements NetworkStateTracker { } } + public void setDependencyMet(boolean met) { + // not supported on this network + } } |