Commit Graph

3459 Commits

Author SHA1 Message Date
The Android Automerger
220a11fbba merge in ics-release history after reset to master 2011-08-10 06:33:53 -07:00
The Android Automerger
2f3e786008 merge in ics-release history after reset to master 2011-08-05 11:17:03 -07:00
Jeff Sharkey
0c001477c2 Fix random stats generation for debugging.
Change-Id: I53f0e9ea9b15fbf7b99886ea8604eda8d3958d8d
2011-08-05 11:09:46 -07:00
The Android Automerger
aa6a2911b7 merge in ics-release history after reset to master 2011-08-04 06:51:53 -07:00
Jeff Sharkey
c76817d370 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
2011-08-03 17:21:07 -07:00
Jeff Sharkey
e2a8a0b310 Merge "Expose quota status for active network." 2011-08-03 17:05:21 -07:00
Chia-chi Yeh
4ac474e88b NativeDaemonConnector: offload callbacks to another thread.
Now callbacks can communicate to the same daemon without causing a
deadlock. This also improves the latency of calls because they no
longer need to wait for the callbacks for the pending events.

Change-Id: I153fcf16bd64de79ee1c1a57d3cfdb12b354cf47
2011-08-03 14:42:11 -07:00
Jeff Sharkey
84b60d6489 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
2011-08-02 18:19:54 -07:00
The Android Automerger
5bbb7ca556 merge in ics-release history after reset to master 2011-08-02 06:53:22 -07:00
Jeff Sharkey
7407e09009 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
2011-07-29 22:24:01 -07:00
The Android Automerger
e10b030925 merge in ics-release history after reset to master 2011-07-25 06:48:14 -07:00
repo sync
0c6ebed1df Updated: Wi-Fi p2p framework
First stage. Get the bones in right now even though
we are not ready on the native side.

Once, we have things underneath working - we will further update the
framework

Change-Id: I4a7dab5cd4267373dc5f8989ae4122f91c384ed5
2011-07-24 10:08:47 -07:00
The Android Automerger
2198befb62 merge in ics-release history after reset to master 2011-07-20 06:47:27 -07:00
Alon Albert
2c295f0c6d Add a getter for the active tag
Change-Id: I597e041867fba7efae41feea63fa196bc10e4aa2
2011-07-19 22:04:22 -07:00
The Android Automerger
8d1de31583 merge in ics-release history after reset to master 2011-07-18 06:43:19 -07:00
Jeff Sharkey
861849e10e Data usage notifs, newly installed apps, defaults.
Only show warning/limit notifications for active networks, since they
aren't actionable for inactive IMSI.  Include IMSI in debug output on
engineering builds.

Move default policy warning to be configured through overlay.  Watch
for newly installed packages to enforce global policy.

Bug: 5038729, 5038541, 4979026, 5023634
Change-Id: I8fc8ab4c23c440a3091504ea16133ed6ababf58e
2011-07-17 16:28:02 -07:00
Jeff Sharkey
2f60c2d402 Acquire wakelock during network stats collection.
Bug: 4517275
Change-Id: I01dfe3b13d7aca84605446e9e9927d0648623552
2011-07-17 13:03:29 -07:00
The Android Automerger
b0c5add0db merge in ics-release history after reset to master 2011-07-15 06:45:40 -07:00
Jeff Sharkey
1bb88919c7 Hide NetworkTemplate details, buffered stats I/O.
Move template matching to builder methods instead of exposing the
internal constants.  Also rule to match Ethernet usage.  Buffer
reading and writing of network stats, making operations 5x faster.

Change-Id: Iedb2d0ab3b26a976811c050f84a164e909eb74b6
2011-07-14 20:43:27 -07:00
The Android Automerger
de42d945e8 merge in ics-release history after reset to master 2011-07-14 07:08:00 -07:00
Mike Lockwood
9a3b109182 Remove some #ifdef HAVE_ANDROID_OS that were needed for the simulator build
Change-Id: I13d9f251f86c05ae5405f37adbf6b8e9660935ba
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-07-13 19:45:44 -04:00
David 'Digit' Turner
ca81f822c4 am bb394c62: am ad485c02: resolved conflicts for merge of a1a57250 to gingerbread-plus-aosp
* commit 'bb394c62a0d1d9e8ab5c1337b01abdf6c03f7d06':
  NativeDaemonConnector: Fix SDCard mounting bug in the emulator.
  Fix missing NL
2011-07-13 14:55:20 -07:00
The Android Automerger
cdb3f0c132 merge in ics-release history after reset to master 2011-07-13 07:47:24 -07:00
Jeff Sharkey
3a0b70f80c Include full network history around current time.
When requesting historical values with time ranges, always include
full values for buckets that span current time.  (It doesn't make
sense to interpolate partial data.)  Move getTotalData() to return
full Entry objects to prepare for packet counts.

Bug: 4691901
Change-Id: I717bd721be9f1d4a47c4121e46e07a56cb15bbf1
2011-07-12 20:20:56 -07:00
Jeff Sharkey
9293bbee48 Merge "Hide NetworkStatsHistory internals." 2011-07-12 15:19:31 -07:00
Jeff Sharkey
188480b216 Hide NetworkStatsHistory internals.
Instead of exposing internal storage details, offer getValues()
accessor which populates values into a recycled structure.

Change-Id: I5228d7099a8f61b2018a435a813435a67dae49b4
2011-07-12 13:57:06 -07:00
Wink Saville
d4c705316e resolved conflicts for merge of 99cd6671 to master
Change-Id: I81ac18b1b8291a96bdfa3386f2fe3633fd7eeb79
2011-07-12 13:56:05 -07:00
David 'Digit' Turner
bb394c62a0 am ad485c02: resolved conflicts for merge of a1a57250 to gingerbread-plus-aosp
* commit 'ad485c02bbab928bec1bfcbca16128d453c6defe':
  NativeDaemonConnector: Fix SDCard mounting bug in the emulator.
  Fix missing NL
2011-07-11 16:15:27 -07:00
David 'Digit' Turner
ad485c02bb resolved conflicts for merge of a1a57250 to gingerbread-plus-aosp
Change-Id: I1f7d1f488f6a86774962d427aca472a8a444e0aa
2011-07-12 00:57:09 +02:00
Jeff Sharkey
21b9c72ad7 Return stats from inactive ifaces, packet counts.
When an iface goes inactive, xt_qtaguid maintains historical counters
instead of discarding.  Now reading and returning those values in
NetworkManagementService summary calls.  Tests to verify stats are
returned.

Modify NetworkStats to include rxPackets and txPackets values, and
move to Entry to eventually hide internal storage details.

Bug: 4984539
Change-Id: I1ba0bb5580c62e946d9dff2cc2a6f64aff403efc
2011-07-11 14:39:56 -07:00
The Android Automerger
f905a7b777 merge in ics-release history after reset to master 2011-07-11 06:45:11 -07:00
Kazuhiro Ondo
8bfb6a160c Concurrent multi-PDP support in TrafficStats
Quick fix to enable concurrent multiple PDP support in TrafficStats.
Just updated the list of hard-coded mobile interfaces for now.

Bug: 4553527
Change-Id: I44ce73f3000542d6457f353bb561a2275684af6b
2011-07-10 14:40:43 -07:00
Jeff Sharkey
1c69b98734 Cached NTP time for system services.
Uses NTP server and timeout from secure settings, or fallback to
defaults in resources.  Update various system services to use cached
NTP time when fresh enough, or force updates as needed.

Bug: 4517273
Change-Id: Ie1c4c4883836013d02ca0bbd850cf8949f93b34b
2011-07-10 14:25:18 -07:00
David 'Digit' Turner
a1a5725080 merge intel x86 patches into gingerbread branch 2011-07-08 18:19:01 +02:00
David 'Digit' Turner
3d49d486c0 NativeDaemonConnector: Fix SDCard mounting bug in the emulator.
This patch fixes a really annoying bug that prevented the emulator
from properly mounting the SD Card.

The issue was that mOutputStream was not initialized when the onDaemonConnected
callbacks are called, just after the daemon's socket connection is established.

In one specific case (MountService a.k.a. VoldConnector), the corresponding
callback function immediately tried to perform a doCommandList() call on the
connector object. The request failed because mOutputStream was still defined
as null when it happened.

By moving the initialization of the variable just before the callback is
invoked, we ensure that things work properly.

Change-Id: I46726a50ef69eaafe70081ff4eda1244b744beba
2011-07-07 03:46:00 +02:00
The Android Automerger
d92268a054 merge in ics-release history after reset to master 2011-07-04 06:47:59 -07:00
Jeff Sharkey
830d546f6b Migrate bandwidth control to NMS, omit history.
Both stats and policy make NMS calls that depend on bandwidth control
being enabled, so move enable/disable into NMS and drop calls when
disabled.  This avoids throwing heavy ISE exceptions when disabled.

Only include recent data when writing NetworkStatsHistory as part of
dumpsys call.  Introduce manual poll event for Settings UI.

Bug: 4982115, 4770435, 4515856
Change-Id: I257820b057af2f0f99c736fb4f61e55b9fdc3e66
2011-06-30 15:47:51 -07:00
The Android Automerger
341ea4a320 merge in ics-release history after reset to master 2011-06-29 06:46:29 -07:00
Jesse Wilson
b05f41c97f Move socket tagging from libcore.
Change-Id: I7515896936c5bbd212c88e2801b831914219a925
2011-06-28 23:43:51 -07:00
Jeff Sharkey
9279006a00 Better network stats parsing, integer tags, async.
Change NMS parsing to handle extended /proc/ stats formats by pairing
values with header keys.  Move TrafficStats to integer tags to match
kernel internals, and offer well-known tags for system services.

Async policy event dispatch from NPMS, and update tests to block for
event dispatch.  Narrow app policy to exclude apps signed with system
key, which are usually critical.

Bug: 4948913, 4903489, 4585280

Change-Id: Idb357227ccaa617906411f309371cea18d7bc519
2011-06-28 17:59:00 -07:00
The Android Automerger
c355ea0331 merge in ics-release history after reset to master 2011-06-28 06:44:37 -07:00
JP Abgrall
2778a1ea73 NetworkStatsService: disabled by default
For now, there is still too much breakage around the kernel's new
qtaguid netfilter.
So no netstats up front.

But enable on the device until wiped:

  ./vendor/google/tools/override-gservices secure:netstats_enabled=1
  adb reboot


Bug: 4903513

Change-Id: I230bd2d4efab85cac5c9abaa7d638c94f5e0c7d6
Signed-off-by: JP Abgrall <jpa@google.com>
2011-06-27 22:16:04 -07:00
The Android Automerger
5735bd5b82 merge in ics-release history after reset to master 2011-06-24 14:22:56 -07:00
The Android Automerger
d8e24705bf merge in ics-release history after reset to master 2011-06-24 13:30:43 -07:00
JP Abgrall
f6cc17c9d1 NetworkStatsService: check kernel bandwidth support before enabling
And catch the actual errors reported by the other side of NetworkManager.

Change-Id: I9a9393b659d6f896ee1bf40a8deaca7853ef8f94
Signed-off-by: JP Abgrall <jpa@google.com>
2011-06-23 15:37:58 -07:00
JP Abgrall
27cb1fa96b NetworkStatsService: check kernel bandwidth support before enabling
And catch the actual errors reported by the other side of NetworkManager.


Change-Id: I9a9393b659d6f896ee1bf40a8deaca7853ef8f94
Signed-off-by: JP Abgrall <jpa@google.com>
2011-06-23 14:13:28 -07:00
Jeff Sharkey
2e546ddbde Enable bandwidth module from stats service.
During systemReady(), tell netd to enable bandwidth tracking module,
which is used to provide detailed stats and controls.

Change-Id: Iecfd8b17a3b90f5a817d731fbe1c71777681ed6e
2011-06-22 21:44:12 -07:00
Jeff Sharkey
3bc842e4c3 Teach NetworkIdentity about roaming.
And correctly upgrade NetworkIdentitySet written to disk, assuming
that old values aren't roaming.

Bug: 4724762
Change-Id: Ic25897ebbaf43be2390174d8e5fd08386bc8a345
2011-06-19 22:21:05 -07:00
Jeff Sharkey
b590477065 Persist "tagged" network stats along with UIDs.
Now stores tags other than TAG_NONE (0x0), which are useful for app
debugging.  Combine UID and tag together into single long key, and
expose tag data through AIDL when requested.  Change NMS to track
TAG_NONE as total UID traffic, matching the kernel definition.

Added TAG_MAX_HISTORY to control how long tag-granularity statistics
are stored; overall UID usage is still kept for UID_MAX_HISTORY.  Fix
bug to trim NetworkStatsHistory outside normal polling loops to catch
non-active networks and UIDs.

Test to verify UID and tag packing, and to verify that UID traffic on
two networks are combined to match MOBILE_ALL template.

Change-Id: If0e039416d9e7f63b1a39e04cddfb1133b5a78ee
2011-06-19 21:58:39 -07:00
Jeff Sharkey
c04cda602c Handle removed UIDs in network stats and policy.
When UID_REMOVED, clean up any existing UID network policy so it
doesn't linger for future apps.  Also move any NetworkStatsHistory
to special UID_REMOVED tracking bucket.

Tests for new removal code.  Also test detailed UID stats, including
network changes to verify template matching logic.

Bug: 4584212
Change-Id: I9faadf6b6f3830eb45d86c7f1980a27cdbcdb11e
2011-06-19 01:08:12 -07:00