Commit Graph

2023 Commits

Author SHA1 Message Date
The Android Automerger
6ee8c33aa8 merge in ics-release history after reset to master 2011-09-02 16:02:32 -07:00
Jeff Sharkey
b63138c9b9 Sample network statistics for sanity check.
After detailed poll events, sample high-level network statistics to
sanity check iface totals against UID totals.

Bug: 5248382
Change-Id: I1c1fbb7c094c9ff0c9dde416467c563dda68f478
2011-09-01 15:07:19 -07:00
The Android Automerger
31951e7907 merge in ics-release history after reset to master 2011-08-30 13:42:46 -07:00
The Android Automerger
49c215f9f4 merge in ics-release history after reset to master 2011-08-30 12:45:34 -07:00
The Android Automerger
abaf3d80b2 merge in ics-release history after reset to master 2011-08-30 06:33:59 -07:00
Jeff Sharkey
b4d8c1fd1c 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
2011-08-29 16:10:43 -07:00
The Android Automerger
7f1160b40b merge in ics-release history after reset to master 2011-08-29 06:33:59 -07:00
Jeff Sharkey
dcaeff3175 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
2011-08-26 14:19:54 -07:00
Jeff Sharkey
60ca02379f 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
2011-08-24 16:00:39 -07:00
Jeff Sharkey
93db945091 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
2011-08-23 18:46:14 -07:00
The Android Automerger
b13942e4ef merge in ics-release history after reset to master 2011-08-16 06:34:02 -07:00
Jeff Sharkey
2665eeb9d4 Merge "Foreground/background network stats using sets." 2011-08-15 18:44:15 -07:00
Jeff Sharkey
806d1fdf9a 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
2011-08-15 17:30:25 -07:00
Jeff Sharkey
7b331c0451 Add NativeDaemonConnector users to watchdog.
To catch instances where NativeDaemonConnector hangs while executing
commands, add users to system_server watchdog.  Also moved qtaguid
enabler to separate thread to prevent blocking systemReady().

Bug: 5145437
Change-Id: I4c6c1dc09864a1c05f9486a31faa1b366548e911
2011-08-10 13:42:01 -07:00
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