summaryrefslogtreecommitdiffstats
path: root/core/java/android/net
Commit message (Collapse)AuthorAgeFilesLines
* Notify policy listeners about metered ifaces.Jeff Sharkey2011-06-172-10/+11
| | | | | | | | | | Currently, kernel definition of metered networks is applied at the interface level. This change maintain list of those metered ifaces and notifies policy listeners, like ConnectivityService. (This gives us a consistent picture of when a network would be blocked.) Bug: 4601393 Change-Id: I277d5ca96ab967a1c1c3f1da8f9587557cd6d74c
* Merge "DownloadManager flags for network policy."Jeff Sharkey2011-06-161-0/+14
|\
| * DownloadManager flags for network policy.Jeff Sharkey2011-06-161-0/+14
| | | | | | | | | | | | | | Handful of DownloadManager flags to record when a download was paused because of NetworkPolicyManager rules. Change-Id: I99fc47f529cb6c8a42dbeca049e0cd0f1556eac4
* | am 241b65ac: am 5f350512: Merge "Reset connections AFTER we take down the ↵Robert Greenwalt2011-06-161-41/+0
|\ \ | | | | | | | | | | | | | | | | | | network." into honeycomb-LTE * commit '241b65aca93e263f0869c5bec4ad1dbda0dec6db': Reset connections AFTER we take down the network.
| * \ Merge "Reset connections AFTER we take down the network." into honeycomb-LTERobert Greenwalt2011-06-161-41/+0
| |\ \
| | * | Reset connections AFTER we take down the network.Robert Greenwalt2011-06-161-41/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you do it before you have a race condition and some apps will manage to reconnect on the dieing network before it goes and then get no notification when it goes. bug: 3408025 Change-Id: I5386ff313c759b3f687bc38731454ab43dbe76b8
* | | | Merge "VPN: migrate from generic Bundle to our own Parcelable VpnConfig."Chia-chi Yeh2011-06-162-42/+3
|\ \ \ \
| * | | | VPN: migrate from generic Bundle to our own Parcelable VpnConfig.Chia-chi Yeh2011-06-152-42/+3
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | Note that VpnConfig is for internal use only. Also remove hidden methods from ConnectivityManager. Change-Id: Ic298c4dc9a2c6c452bd8f4be6fa84e7ac489c0c4
* | | | am 11954872: am 5af3405f: am ecda5461: Merge "Fix lease duration handling" ↵Irfan Sheriff2011-06-151-7/+18
|\ \ \ \ | |/ / / |/| / / | |/ / | | | | | | | | | into honeycomb-mr2 * commit '1195487228e1eb6c8859368286168051bd505b2f': Fix lease duration handling
| * | am ecda5461: Merge "Fix lease duration handling" into honeycomb-mr2Irfan Sheriff2011-06-151-7/+18
| |\ \ | | |/ | |/| | | | | | | * commit 'ecda5461603b6de77beb045dfdf82dad7ae48d61': Fix lease duration handling
| | * Fix lease duration handlingIrfan Sheriff2011-06-151-7/+18
| | | | | | | | | | | | | | | | | | | | | Convert lease time in seconds to long before alarm set up and add sanity check Change-Id: I99524c97d9a643ffa8234d016d0e819a284977a1
* | | Include template in data warning/limit intents.Jeff Sharkey2011-06-151-0/+23
| | | | | | | | | | | | | | | | | | | | | When launching warning/limit UI, include the template that triggered the notification. Also move actions and extra into contract class. Change-Id: Id2e63fd2d2e36a137a3fd8f889c7256038ca5f2e
* | | Data usage warning and limit notifications.Jeff Sharkey2011-06-141-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Watch for network statistics to cross NetworkPolicy warning or limit, and show notifications to user as needed. Currently checks during any statistics update, but will eventually move to event registration through netd when kernel supports. Fixed accounting bug in getSummaryForNetwork(). Only apply UID policy to applications; applying to system processes could break critical services like RIL. Change-Id: Iac0f20e910e205f3cbc54ec96395ff268b1aa379
* | | Handle always present wired ethernet interfaces at boot.Mike J. Chen2011-06-131-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Devices with always present wired ethernet interfaces (as opposed to usb ethernet dongles) don't have the interface added and removed. Instead, it is present already at boot time. Change EthernetDataTracker to support the already existing at boot time case. Change-Id: I7b8e938f6b07aabd14f00ace55b35b7a05ea5a38 Signed-off-by: Mike J. Chen <mjchen@google.com>
* | | Open up setKeyManager/setTrustManager.Ben Komalo2011-06-131-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | The improved keystore will allow clients (Email not the least of them) to establish SSL connections using custom client certificates. In order to do this properly, the socket factories they use to establish these connections need to be able to customize their behavior. Change-Id: I6e0fa04dd01bd6481dfdad5a71a63e0371d0ad8c
* | | External mutation of full NetworkPolicy set.Jeff Sharkey2011-06-124-19/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of embedding complex template coexistence rules into policy service, rely on external editors to enforce, and offer atomic get/set operations for full policy sets. Generate default mobile policy when none exists, using default of 4GB warning and cycle reset of current day. Dispatch listener events through Handler when holding internal lock, and catch CLASS_UNKNOWN networks in 3G_LOWER template. Change-Id: I063cf1eaf330e32b75d0697b89fc04488e6dfaea
* | | Growable NetworkStats object instead of builder.Jeff Sharkey2011-06-112-52/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | NetworkStats now grows in place with arraycopy() instead of callers needing to know record count a priori. Better growth calculation for both NetworkStats and NetworkStatsHistory; 50% each time. Better estimates of buckets needed in calling services. Change-Id: I3adbffa0b7407612cc6349d9135a8b4eb63cd440
* | | Move data cycle methods to framework object.Jeff Sharkey2011-06-101-1/+80
| | | | | | | | | | | | | | | | | | | | | Moved so they can be used by both system service and Settings UI, since they both work with data usage cycles. Still covered by tests. Change-Id: I01c0c4db6da9457dd867c9167d31a5f9f8e5f5d9
* | | Interface-level network policy, persist policies.Jeff Sharkey2011-06-105-1/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Define NetworkPolicy as cycle-reset day and warning/limit values, and set/get through NetworkPolicyManager. Watch ConnectivityManager for network connection events, and apply quota rules based on matching interfaces. Policy service matches based on strong identity to support IMSI-specific policy values. Calculates remaining quota based on current stats recorded since the last reset cycle day. Tests to verify edge cases around February. Persist network and UID policies in XML, and restore on boot. Change-Id: Id40ba7d6eed6094fbd5e18e6331286c606880d80
* | | Persist network stats using AtomicFile.Jeff Sharkey2011-06-094-7/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implements read/write of network stats using AtomicFile, along with magic number and versioning. Stores in "/data/system/netstats.bin" for now. Tests to verify that stats are persisted across a simulated reboot, and to verify that TEMPLATE_WIFI is working. Fixed bug where kernel counters rolling backwards would cause negative stats to be recorded; now we clamp deltas at 0. Change-Id: I53bce26fc8fd3f4ab1e34ce135d302edfa34db34
* | | The service part of the user space VPN support.Chia-chi Yeh2011-06-082-0/+49
| | | | | | | | | | | | | | | | | | The dialogs will be in another change. Change-Id: I0cdfd2ef21ffd40ee955b3cbde5ada65dbfdb0bc
* | | resolved conflicts for merge of e139167c to masterRobert Greenwalt2011-06-081-9/+7
|\ \ \ | |/ / | | | | | | Change-Id: Ic4d8aae7dd457457d9cc8ba081b273e425729f86
| * | resolved conflicts for merge of 8de47a2f to honeycomb-LTERobert Greenwalt2011-06-071-9/+9
| |\ \ | | |/ | | | | | | Change-Id: I8193235a4c7e574635e17b2eb05bb5420a3c6749
| | * Reveal some network constants.Robert Greenwalt2011-05-311-9/+9
| | | | | | | | | | | | | | | | | | | | | Since we've already decided to inc the sdk version we should try to get these in too. bug:4500218 Change-Id: I6dcb401bf30f1b06f02be0a93681a190d7ee5775
| | * DO NOT MERGE Add DhcpStateMachineIrfan Sheriff2011-05-122-0/+363
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add DhcpStateMachine for interation with dhcpcd - Supports wakeup and renewal on dhcp - Supports multiple controllers to use the state machine simultaneously - Optionally, a controller can request a notification prior to DHCP request/renewal being sent Change-Id: I5324814b19ff19863aa6fa89f1e3f0a202930c98
* | | Compute range-based usage in NetworkStatsHistory.Jeff Sharkey2011-06-071-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When given a start/end range, interpolate between buckets to return the total network usage. Used to summarize detailed UID stats. Method to combine NetworkStatsHistory regardless of bucket size. Used to combine all histories matching a template. Added tests for both methods. Change-Id: Ia463910c0ecf7cf08dcf97c658ad99742bd6b882
* | | UID network stats, secure settings, and random.Jeff Sharkey2011-06-072-10/+63
| | | | | | | | | | | | | | | | | | | | | | | | Collect UID-granularity network stats during regular poll event. Add dumpsys argument to generate fake historical data for debugging, and move stats parameters to Settings.Secure. Change-Id: I09b36a2955dc10c697d4b9c3ff23dcb3ac37bd70
* | | Map network identity using ConnectivityService.Jeff Sharkey2011-06-077-33/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of deriving network identity based on raw subsystem broadcasts, listen for updates from ConnectivityService. Added atomic view of all active NetworkState, and build map from "iface" to NetworkIdentity set for stats tracking. To avoid exposing internal complexity, INetworkStatsService calls use general templates. Added TelephonyManager mapping to classify network types using broad labels like "3G" or "4G", used to drive templates. Cleaned up Objects and Preconditions. Change-Id: I1d4c1403f0503bc3635a59bb378841ba42239a91
* | | Makes SSLCertificateSocketFactory more flexibleBen Komalo2011-06-061-4/+34
| | | | | | | | | | | | | | | | | | | | | Specifically, this adds support for specifying custom {Trust,Key}Managers in the socket factory. Change-Id: I1fdf6587064c71ae0520f73821923dcad8d140ad
* | | Collect historical network stats.Jeff Sharkey2011-06-015-12/+370
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Periodically records delta network traffic into historical buckets to support other services, such NetworkPolicyManager and Settings UI. Introduces NetworkStatsHistory structure which contains sparse, uniform buckets of data usage defined by timestamps. Service periodically polls NetworkStats and records changes into buckets. It only persists to disk when substantial changes have occured. Current parameters create 4 buckets each day, and persist for 90 days, resulting in about 8kB of data per network. Only records stats for "well known" network interfaces that have been claimed by Telephony or Wi-Fi subsystems. Historical stats are also keyed off identity (such as IMSI) to support SIM swapping. Change-Id: Ia27d1289556a2bf9545fbc4f3b789425a01be53a
* | | Tests for NetworkPolicyManager rule generation.Jeff Sharkey2011-06-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Verifies that policy changes trigger rule updates that respect current foregroundActivities status. Also verifies logic that promotes a UID based on its most-foreground PID. Verifies that policy changes result in immediate rule changes. Also verifies that BACKGROUND_DATA_SETTING_CHANGED broadcasts are sent by policy changes. Change-Id: I4fd0dad9e1dbccee2c5968244bb1814e6cb2c6e1
* | | Teach NetworkPolicyManager how to dumpsys itself.Jeff Sharkey2011-06-011-0/+21
| | | | | | | | | | | | | | | | | | | | | Includes details on all internally known UIDs, which can be used for debugging purposes. Change-Id: I340d25212e3c7a76a57de0a94ffeea34b6748941
* | | Policy and rules work for ConnectivityManager.Jeff Sharkey2011-06-016-32/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Teach ConnectivityManager about UID-specific rules derived from policy, such as rejecting network traffic on "paid" interfaces. Calls that return NetworkInfo now filter based on any REJECT rules in effect for the calling UID. (Added uid parameter if callers that still want all interfaces.) Changed NetworkPolicyManager to derive rules based on current policy combined with PowerManager and ActivityManager status, which it passes to ConnectivityService for eventual enforcement through netd. When rules change the usability of a NetworkInfo for a specific UID, it also dispatches CONNECTIVITY_ACTION broadcasts to that UID. Combined paid and background policy together to match current working definition. Change-Id: I797ea49439fcc487cfe2cbc16703d4b91ceb9af6
* | | Tracking merge of dalvik-dev to masterBrian Carlstrom2011-05-271-0/+268
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adapt to change in the way MockWebServer sets up CONNECT proxies. git cherry-pick --no-commit c7e2feee5e7908a019a0de91123c1feb9bdc38bc React to move of Base64 in libcore git cherry-pick --no-commit 119f7ebdd1f8df3a8ff8e3b8056bff725d569253 Expose and document android.net.HttpResponseCache. git cherry-pick --no-commit 7b73f0fdb8c032a65c55610541d66385bd8bcbe6) make update-api Change-Id: Ieb48b304ea38ee8c2ec01e860d99b1404583889e
* | | Observe screen on/off events in NetworkPolicy.Jeff Sharkey2011-05-231-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The POLICY_REJECT_BACKGROUND policy requires that network traffic be blocked when a UID goes into the background. Even if the UID has an activity in the foreground, it's considered "background" if the screen is turned off. This changes watches for SCREEN_ON/OFF broadcasts, and rule generation now observes screen state. It also introduces an observer pattern so that ActivityManager doesn't directly know about NetworkPolicy, and moves the service management into SystemServer. Change-Id: Ie7a84929d3ca60ae4578d47e19d5a8da10fd8d58
* | | APIs to profile network usage for current UID.Jeff Sharkey2011-05-213-7/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added startDataProfiling() and stopDataProfiling() to TrafficStats, which can be used by apps to measure network usage delta between two points in time. Currently takes two NetworkStats snapshots and returns delta, which will eventually include tag-level granularity. Added tests for NetworkStats delta subtraction. Added NMS.getNetworkStatsUidDetail() that returns stats for specific UID. Always gives stats access for the calling UID, otherwise enforces that caller has permission. Fix readSingleLongFromFile(), since /proc/ files don't have well-defined lengths. Change-Id: Ic5b6414d8effbd66846e275b00d4b8a82c74589d
* | | am 09ded82b: am ab5baa1d: Merge "Reset connection while data state changed." ↵Wink Saville2011-05-192-1/+29
|\ \ \ | |/ / | | | | | | | | | | | | | | | into honeycomb-LTE * commit '09ded82b784b9f6e01d4cd4298097fd2b459560b': Reset connection while data state changed.
| * | Merge "Reset connection while data state changed." into honeycomb-LTEWink Saville2011-05-192-1/+29
| |\ \
| | * | Reset connection while data state changed.Wink Saville2011-05-182-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Check data call states and reset connection if any link properties changed. Change-Id: I008aea969378648192852161959fdf4aad6211a1
* | | | Merge c41aefe1Jean-Baptiste Queru2011-05-192-90/+52
|\ \ \ \ | |/ / / | | | | | | | | Change-Id: I70fc4382f832d1a2bded8a5ee7d9b96fac77879b
| * | | Switch to use netd to add/remove routes.Robert Greenwalt2011-05-182-90/+52
| |/ / | | | | | | | | | | | | | | | Also adds support for v6 routes and for removing single routes. Change-Id: I1c4f08c7938371090944d8d6f603e1e0d6d70c01
* | | am b22a9fd9: am 01758e81: Linkproperties update via unsol data call state ↵Kazuhiro Ondo2011-05-181-0/+15
|\ \ \ | |/ / | | | | | | | | | | | | | | | change. * commit 'b22a9fd9bb32133cbc7dc4fc7752dbf68e52dffe': Linkproperties update via unsol data call state change.
| * | Linkproperties update via unsol data call state change.Kazuhiro Ondo2011-05-171-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Handles the scenario of radio technology handover with IP continuity. Once RIL/Modem finished a handover operation, an unsol data call state change will be send up to FW notifying all link propertes changes. FW will then re-configure the device with new link properties including iptable used by Tethering. Change-Id: I05e29f66ac3db8ba4274d3662642607742ba1d12
* | | Merge "First pass at NetworkPolicy and activity tracking."Jeff Sharkey2011-05-172-0/+102
|\ \ \
| * | | First pass at NetworkPolicy and activity tracking.Jeff Sharkey2011-05-132-0/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New system service that maintains low-level network policy rules and collects statistics to drive those rules. Will eventually connect to netfilter kernel module through NetworkManagementService and "netd". Begin tracking foreground activities in ActivityManagerService, which is updated as part of OOM adjustment. Eventually a network policy of POLICY_REJECT_BACKGROUND will reject network traffic from background processes. Change-Id: I5ffbbaee1b9628e9c3eff6b9cb2145fc5316e64d
* | | | Add Socket tagging for granular data accounting.Jeff Sharkey2011-05-131-4/+60
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | Introduces public API to apply "tags" to track data traffic originating from the current thread. (Under the hood, the tags are maintained and applied in BlockGuard.) Also adds tag/untag methods for developers who maintain their own Socket pools. Change-Id: Ic2dd3155559a93a7b613c7853748d4c44fb3a39e
* | | am 9c7c8794: am 76a118dd: Merge "Fix initialization of RouteInfo" into ↵Wink Saville2011-05-121-3/+15
|\ \ \ | |/ / | | | | | | | | | | | | | | | honeycomb-LTE * commit '9c7c87941446cdd1263a87a8c4cc5672082c7e12': Fix initialization of RouteInfo
| * | Fix initialization of RouteInfoKazuhiro Ondo2011-05-111-3/+15
| | | | | | | | | | | | | | | | | | IPv6 gateway is not correctly set in RouteInfo Change-Id: I24b1ab71a64e3097c9ba641899240fc27847b86c
* | | am 441bc9a6: am e6848fac: Merge "Fix the adding of host routes." into ↵Robert Greenwalt2011-05-112-17/+96
|\ \ \ | |/ / | | | | | | | | | | | | | | | honeycomb-LTE * commit '441bc9a6f41ca1678a6c965bec7e2f18227ac100': Fix the adding of host routes.
| * | Fix the adding of host routes.Robert Greenwalt2011-05-102-17/+96
| | | | | | | | | | | | | | | | | | We used to just add Change-Id: I991e4cc976cc2932887dd3242fd50e013d521b0a