diff options
author | Jeff Sharkey <jsharkey@android.com> | 2011-08-19 02:24:24 -0700 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2011-08-23 18:45:44 -0700 |
commit | 8e28b7d78232f6cf08739ca0d129cc7f9e650801 (patch) | |
tree | c72bf1bcc07e1dd02764a4f4738a56735e5f4252 /wifi | |
parent | 7a12d6ba14a35276fd3afb314d6c95055da4c6f0 (diff) | |
download | frameworks_base-8e28b7d78232f6cf08739ca0d129cc7f9e650801.zip frameworks_base-8e28b7d78232f6cf08739ca0d129cc7f9e650801.tar.gz frameworks_base-8e28b7d78232f6cf08739ca0d129cc7f9e650801.tar.bz2 |
Proactively disable data when over policy limit.
Add policy controls to NetworkStateTracker which are combined with
other user preference and internal flags to decide if data connection
should be established. Better locking around enabled flags.
When data network would be over limit, proactively disable data on
that network. Enable when policy is snoozed or when cycle resets.
Track and dismiss notifications from now-stale policies.
Bug: 4587023, 5178147
Change-Id: Ibfcc9f73cda7c369209af701b46eddd3d1943f2d
Diffstat (limited to 'wifi')
-rw-r--r-- | wifi/java/android/net/wifi/WifiStateTracker.java | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/wifi/java/android/net/wifi/WifiStateTracker.java b/wifi/java/android/net/wifi/WifiStateTracker.java index c20c716..956c3f2 100644 --- a/wifi/java/android/net/wifi/WifiStateTracker.java +++ b/wifi/java/android/net/wifi/WifiStateTracker.java @@ -16,23 +16,20 @@ package android.net.wifi; - - import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; -import android.net.ConnectivityManager; import android.net.LinkCapabilities; -import android.net.NetworkInfo; import android.net.LinkProperties; +import android.net.NetworkInfo; import android.net.NetworkStateTracker; import android.net.wifi.p2p.WifiP2pManager; import android.os.Handler; import android.os.Message; +import android.util.Slog; import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicInteger; /** * Track the state of wifi for connectivity service. @@ -44,6 +41,8 @@ public class WifiStateTracker implements NetworkStateTracker { private static final String NETWORKTYPE = "WIFI"; private static final String TAG = "WifiStateTracker"; + private static final boolean LOGV = true; + private AtomicBoolean mTeardownRequested = new AtomicBoolean(false); private AtomicBoolean mPrivateDnsRouteSet = new AtomicBoolean(false); private AtomicBoolean mDefaultRouteSet = new AtomicBoolean(false); @@ -135,11 +134,14 @@ public class WifiStateTracker implements NetworkStateTracker { return mNetworkInfo.isAvailable(); } - /** - * @param enabled - */ - public void setDataEnable(boolean enabled) { - android.util.Log.d(TAG, "setDataEnabled: IGNORING enabled=" + enabled); + @Override + public void setUserDataEnable(boolean enabled) { + Slog.w(TAG, "ignoring setUserDataEnable(" + enabled + ")"); + } + + @Override + public void setPolicyDataEnable(boolean enabled) { + Slog.w(TAG, "ignoring setPolicyDataEnable(" + enabled + ")"); } /** |