diff options
| author | Jeff Sharkey <jsharkey@android.com> | 2012-04-19 23:01:08 -0700 |
|---|---|---|
| committer | Jeff Sharkey <jsharkey@android.com> | 2012-04-20 15:57:19 -0700 |
| commit | 9f6e4ba50e7e73704c7fbd3ba65fe73bdf8ad73f (patch) | |
| tree | ed8045c7cfb0fcea3c10b0f76d2808116ac1545e /core | |
| parent | f0c4c658488824707c206551fd1ccc0a0781031e (diff) | |
| download | frameworks_base-9f6e4ba50e7e73704c7fbd3ba65fe73bdf8ad73f.zip frameworks_base-9f6e4ba50e7e73704c7fbd3ba65fe73bdf8ad73f.tar.gz frameworks_base-9f6e4ba50e7e73704c7fbd3ba65fe73bdf8ad73f.tar.bz2 | |
Connect metered DHCP hint for Wi-Fi networks.
When DHCP lease includes vendor info indicating that remote Wi-Fi
network is metered, advise NetworkPolicy. Users can still manually
change the metered flag in Settings.
Also remove any policies belonging to removed Wi-Fi networks, and
teach isNetworkMetered() about ethernet networks.
Bug: 6344821, 6369307, 6365872
Change-Id: I108606c6fddf2d02828fcab011f3a1501415f1bc
Diffstat (limited to 'core')
| -rw-r--r-- | core/java/android/net/DhcpInfoInternal.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/java/android/net/DhcpInfoInternal.java b/core/java/android/net/DhcpInfoInternal.java index 7ab8047..c87c34b 100644 --- a/core/java/android/net/DhcpInfoInternal.java +++ b/core/java/android/net/DhcpInfoInternal.java @@ -142,6 +142,14 @@ public class DhcpInfoInternal { } } + /** + * Test if this DHCP lease includes vendor hint that network link is + * metered, and sensitive to heavy data transfers. + */ + public boolean hasMeteredHint() { + return "ANDROID_METERED".equals(vendorInfo); + } + public String toString() { String routeString = ""; for (RouteInfo route : mRoutes) routeString += route.toString() + " | "; |
