Commit graph

13,045 commits

Message SHA1
Selectively add stats based on iface active state.
Only combine /proc/net/dev and xt_qtaguid stats when iface is marked
as active.  When inactive, only return xt_qtaguid stats.  When iface
is unknown to xt_qtaguid, always pass through /proc/net/dev stats.

Bug: 5242730
Change-Id: I469fc6abe45309f794afebca814cbb39e4f13af5

Jeff Sharkey   commited 2011-09-01 15:23:38 -07:00
8e3b6c6eee
merge in ics-release history after reset to master
The Android Automerger   commited 2011-09-01 06:33:57 -07:00
a148e070cd
Create new isNetworkSupported API
Useful for checking if on a wifi-only device.
Similar to asking for NetworkInfo for a network type and checking for
null, though here the intent is explicit.

bug:5087537
Change-Id: Ia3ddd09b6b735b8b3ceb7a347891e015fd96b218

Robert Greenwalt   commited 2011-08-31 16:53:12 -07:00
0114f6e8e9
merge in ics-release history after reset to master
The Android Automerger   commited 2011-08-30 13:42:46 -07:00
b8660cf43f
merge in ics-release history after reset to master
The Android Automerger   commited 2011-08-30 12:45:34 -07:00
751c7451c7
Introduce immediate CONNECTIVITY_ACTION variant.
New broadcast that is dispatched immediately after connectivity
changes have been handled by ConnectivityService, bypassing any
applicable CONNECTIVITY_CHANGE_DELAY.

Also protect CONNECTIVITY_CHANGE broadcasts, since they should only
be sent by system.

Bug: 5198167
Change-Id: I75f1fb44b21da1879f0ab960bcaa481126d70fde

Jeff Sharkey   commited 2011-08-29 16:10:43 -07:00
971cd16561
Always splice historical data stats, debug info.
When reading network counters, always splice in xt_qtaguid values
to avoid counting backwards. Test to verify.

Remove verbose logging around global alerts, and add dumpsys debug
info for NMS and MDST. Also fix subtle bug around stats persisting
and dumping.

Bug: 5212893, 5211028
Change-Id: I783e5286637a67ee2dd2b09878198711a926d0cb

Jeff Sharkey   commited 2011-08-26 14:19:54 -07:00
0a7279c958
Data usage buckets active time, parsing ISE.
When recording data usage, measure the actual active time, since
buckets can be quite long.  Offer incrementOperationCount() version
that reads thread stats tag for caller.  Rethrow any NPE as ISE
during stats parsing, which callers already handle.

Bug: 5171812, 5184508, 5180659
Change-Id: I6da80ccc0162be68bee279529e3a23b6f98ebd87

Jeff Sharkey   commited 2011-08-24 16:00:39 -07:00
3dadd0f1f6
Register for kernel global data usage alerts.
Instead of polling every 15 minutes, register for alerts that trigger
when system-wide traffic passes a threshold.  Still mixed with polling
to persist UID stats, but relaxed to 30 minutes.  Currently watches
for every 512kB.

Make persistence decision separately for network versus UID, and use
total delta bytes when making decision.  Use light bootstrap during
systemReady() instead of heavy poll, which had been force-loading all
UID data unnecessarily.

Bug: 5023631
Change-Id: I04b723d6c4bf872fb1028071122dba66a8e1b576

Jeff Sharkey   commited 2011-08-23 18:46:14 -07:00
d3b657612d
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

Jeff Sharkey   commited 2011-08-23 18:45:44 -07:00
805662d8fa
Merge "Background data notification, API clean up."
Jeff Sharkey   authored and   Android (Google) Code Review   commited 2011-08-18 15:01:10 -07:00
e612a38faa
Background data notification, API clean up.
When restricting background data, show ongoing notification to give
easy access to re-enable. Deprecate getBackgroundDataSetting() API
to always return true, since NetworkInfo.isConnected() is new source
of truth. Handle upgrade path by reading from existing secure value,
and kick one last broadcast when changing value. Remove background
data code from ConnectivityService.

Remove warning alerts, since they push ifaces into restricted list;
should only happen when iface has limit.

Bug: 5163559, 5129421
Change-Id: I0064d9d643656a4d32aaae51d4a58bce49fe295f

Jeff Sharkey   commited 2011-08-17 14:12:42 -07:00
39c01ebcce
Merge "P2p enhancements"
repo sync   authored and   Android (Google) Code Review   commited 2011-08-16 14:50:56 -07:00
7c309101fe
VPN: reset legacy VPN when resetting IPv4 addresses.
Currently legacy VPN only works on IPv4, and it should always
turn down when the addresses are changed. It assumed that the
interface will be brought down and up, so the event can be
detected via interfaceStatusChanged(). However, the assumption
was incorrect and the event is actually driver-dependent. To
fix this issue, ConnectivityService now tells VPN that the
interface is down when resetting IPv4 addresses.

Change-Id: I76d15e56552d86635c5b274ca980be5da905a6fb

Chia-chi Yeh   commited 2011-08-16 10:08:33 -07:00
4a243f5ea1
Merge "Flush central DNS cache when things change."
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2011-08-16 09:41:54 -07:00
2d5e58e97e
Foreground/background network stats using sets.
Teach NetworkStats about "counter sets" coming from kernel, and use
them to track usage in foreground/background.  Add AID_NET_BW_ACCT to
system_server so it can control counter sets.

Move to composite key of NetworkIdentitySet, UID, set, and tag when
recording historical usage.  Persisting still clusters by identity,
since that is heaviest object.

Request async stats poll during systemReady() to bootstrap later
delta calculations. Reset kernel counters when UID removed. Update
various tests.

Bug: 5105592, 5146067
Change-Id: Idabec9e3ffcaf212879821515602ecde0a03de8c

Jeff Sharkey   commited 2011-08-15 17:30:25 -07:00
9c11e89fe2
Flush central DNS cache when things change.
Flushes the cache for an interface when
either routes or DNS servers change.

Change-Id: I021305f781be669aaa12074dc1cc21511f49eac4

Robert Greenwalt   commited 2011-08-15 14:26:53 -07:00
8d77725fa7
P2p enhancements
- ConnectivityService interaction and support for running dhcp server
and client

- State machine enhancements for connectivity interaction

Change-Id: Iba3beb8c87554ffd67a7b7e852bbb4dd8666a4f5

repo sync   commited 2011-08-10 15:53:49 -07:00
f5de557544
Remove default routes for non-default networks.
Recoding/port of a change that existed in GB but got dropped
in the shuffle.

bug:5036222
Change-Id: I87e819d255c0c46f3ec8fe0fe18d27ae9df1ae36

Robert Greenwalt   commited 2011-08-09 16:52:58 -07:00
08ae9bc349
resolved conflicts for merge of 0e9cd3b2 to master
Change-Id: I026b01805c81d8b26d22e4a195e5e38655a34d32

Wink Saville   commited 2011-08-05 11:40:22 -07:00
7e4333cbab
am 090df1dc: Merge "Delay connectivity change notifications." into honeycomb-LTE
* commit '090df1dc4188e5b9ef10a0aca5081a196085ff56':
  Delay connectivity change notifications.

Wink Saville   authored and   Android Git Automerger   commited 2011-08-04 16:11:41 -07:00
0e9cd3b2dc
Merge "Network stats with varint, omit parcel fields."
Jeff Sharkey   authored and   Android (Google) Code Review   commited 2011-08-04 15:39:24 -07:00
842b3bf16c
Merge "Rewrote DnsPinger - now is async and concurrant"
Irfan Sheriff   authored and   Android (Google) Code Review   commited 2011-08-04 15:34:47 -07:00
fd1ffa4b9f
Delay connectivity change notifications.
Because changes to the route tables take time to propagate
we add a delay when sending out change notifications. This allows
applications, such as GTalk, to create sockets without encountering
a 3 minute timeout.

Bug: 5008488
Change-Id: I0eefb03a5d6358a58ea6ae5b4f697ff302b5511d

Wink Saville   commited 2011-08-04 15:01:58 -07:00
4f0de1e285
Rewrote DnsPinger - now is async and concurrant
Change-Id: I93e1374ae857832935202614e34ce18f040fcfc7

Isaac Levy   commited 2011-08-04 10:35:29 -07:00
73c6b22da0
Network stats with varint, omit parcel fields.
Persist NetworkStatsHistory using variable-length encoding; since
most buckets have small numbers, we can encode them tighter. Initial
test showed 44% space savings. Also persist packet and operation
counters.

Let NetworkStatsHistory consumers request which fields they actually
need to reduce parcel overhead.

Tests for verify varint and history field requests, also verify end-
to-end by persisting history into byte[] and restoring. Expose
bandwidth control enabled state. Extend random generation to create
packet and operation counts. Moved operation counts to long.

Fix bug that miscalculated bytes since last persist, which would
cause partial stats loss when battery pulled.

Bug: 4581977, 5023706, 5023635, 5096903
Change-Id: If61e89f681ffa11fe5711471fd9f7c238d3d37b0

Jeff Sharkey   commited 2011-08-03 17:21:07 -07:00
13d6787be8
Merge "Expose quota status for active network."
Jeff Sharkey   authored and   Android (Google) Code Review   commited 2011-08-03 17:05:21 -07:00
f1a83d612f
Expose quota status for active network.
Create API to expose quota status derived from underlying network
policy.  This is designed to support applications making informed
decisions when performing network requests.

Fix bug with random stats generation, and write policy when changing
restrict background data flag.  Deprecate EXTRA_NETWORK_INFO, since
it varies based on UID.

Bug: 4517283, 5088603
Change-Id: Ic6893a8967f69937e466be226ba7bb86ef5a5d2d

Jeff Sharkey   commited 2011-08-02 18:19:54 -07:00
66fa96870b
Reduce ConnectivityService logging
bug:5106520
Change-Id: I4a7a5cac51c09e9e2275b30b7b2c053f94b9088d

Robert Greenwalt   commited 2011-08-02 17:18:41 -07:00
78f2811841
Merge "Fix networktype on per process DNS setting"
repo sync   authored and   Android (Google) Code Review   commited 2011-08-02 14:48:43 -07:00
857b44da3f
Fix networktype on per process DNS setting
This potentially has no impact on mobile due to DNS settings being the same. Seperate this change out of the p2p change

Change-Id: I70fff9b1e13015956793b19732785037adb0af24

repo sync   commited 2011-08-02 13:40:58 -07:00
3035f65a51
Merge "Add operation counts to network statistics."
Jeff Sharkey   authored and   Android (Google) Code Review   commited 2011-08-01 16:33:50 -07:00
c4c27030ca
Add operation counts to network statistics.
Provide API to increment "operation counts" for a UID and tag, used
to eventually derive bytes/operation stats.  Internally is stored at
network layer, but should belong at data layer.  Switch profiling
to use data layer stats, which are emulated by summarizing network
layer details.

Read packet counts from new /proc/ columns and collect them into
NetworkStatsHistory.  Prevent double-counting by ignoring values from
first snapshot.  Watch for duplicate /proc/ entries.  Update tests
to verify packet and operation counters.

Bug: 5052136, 5097392
Change-Id: I1832f65a2b8a9188f8088f253474a667c21a2f09

Jeff Sharkey   commited 2011-07-29 22:24:01 -07:00
7026767763
am 30f045c9: am a50a0e90: Merge "Fix NPE when going from proxy to no proxy." into honeycomb-LTE
* commit '30f045c900':
  Fix NPE when going from proxy to no proxy.

Robert Greenwalt   authored and   Android Git Automerger   commited 2011-07-29 10:55:58 -07:00
6e02db1b8d
am a50a0e90: Merge "Fix NPE when going from proxy to no proxy." into honeycomb-LTE
* commit 'a50a0e90fd':
  Fix NPE when going from proxy to no proxy.

Robert Greenwalt   authored and   Android Git Automerger   commited 2011-07-29 10:53:16 -07:00
30f045c900
Merge "Fix NPE when going from proxy to no proxy." into honeycomb-LTE
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2011-07-29 10:51:32 -07:00
a50a0e90fd
Fix NPE when going from proxy to no proxy.
bug:5081431
Change-Id: I68a8cca94e4612bd9ee2faf1123e0b63dc25b833

Robert Greenwalt   commited 2011-07-29 10:03:37 -07:00
027f505669
am fec26c50: am f3ab069b: Make copy-constructor make deep copy.
* commit 'fec26c5097':
  Make copy-constructor make deep copy.

Robert Greenwalt   authored and   Android Git Automerger   commited 2011-07-29 09:24:38 -07:00
2351e41ea8
am f3ab069b: Make copy-constructor make deep copy.
* commit 'f3ab069bec':
  Make copy-constructor make deep copy.

Robert Greenwalt   authored and   Android Git Automerger   commited 2011-07-29 09:20:51 -07:00
fec26c5097
Make copy-constructor make deep copy.
Used to grab immutables but now will copy the data so the result
is mutable and we don't get crashes.

bug:5051667
Change-Id: I0878bf8c58069055f528121541d1911f404cbe49

Robert Greenwalt   commited 2011-07-28 17:21:25 -07:00
f3ab069bec
resolved conflicts for merge of 377cf20b to master
Change-Id: Ib7f3521b0af6df9346cf940d69f2988b1c87e129

Robert Greenwalt   commited 2011-07-27 10:00:36 -07:00
49f762eeee
resolved conflicts for merge of 9520d6af to honeycomb-plus-aosp
Change-Id: Ic839eb7bd8081b94802dbbf9140b9d1fa0cf7df3

Robert Greenwalt   commited 2011-07-27 09:27:00 -07:00
377cf20b83
resolved conflicts for merge of 9520d6af to honeycomb-plus-aosp
Change-Id: If4dc99c558dc45c9a7ff8d3ea5be69578b4ee793

Robert Greenwalt   commited 2011-07-26 15:26:02 -07:00
4d5ecf6bb2
Merge "Use dns proxy a bit." into honeycomb-LTE
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2011-07-26 13:21:09 -07:00
9520d6af5a
am 8ba16551: Merge "Fix build." into honeycomb-plus-aosp
* commit '8ba16551bc11379e7c1b1815612909e2515d0cb2':
  Fix build.

Robert Greenwalt   authored and   Android Git Automerger   commited 2011-07-25 17:25:30 -07:00
b6ce2c7b76
Use dns proxy a bit.
Sets the current default interface and sets the dns per interface.
port of changes 23041 and 22098 from opensource.
bug:5060618

Change-Id: I80e7ef88727eeb8ff2b48059f69b270e5a6b5c16

Robert Greenwalt   commited 2011-07-25 17:00:13 -07:00
fd0597c8e4
resolved conflicts for merge of aaf31586 to master
Change-Id: I9e8faaa94f9b251a9c003dc6b9a3e2a97c4564a9

Robert Greenwalt   commited 2011-07-25 16:06:25 -07:00
fce7186be1
Fix build.
Add NetworkUtils function missed in manual merge.

Change-Id: Ifce8f2988bb581ddc9b971b8af07a32f46c91e14

Robert Greenwalt   commited 2011-07-25 14:00:42 -07:00
9186900f54
resolved conflicts for merge of 26ecc31f to honeycomb-plus-aosp
Change-Id: I23f42e247884f0c9d5ae4d3466213592dd3433d9

Robert Greenwalt   commited 2011-07-25 12:08:19 -07:00
aaf31586ce
Merge "Fix USB tethering"
Mike Lockwood   authored and   Android (Google) Code Review   commited 2011-07-23 19:36:32 -07:00
865fcf3eb3