Commit graph android_packages_modules_Co.../core/java
Message SHA1
Fix sync problem in NsdManager
The NsdManager init was thinking it was done before the AsyncChannel
was fully setup and if the setup were slow and the app fast, the app
could make calls to the NsdManager that it wasn't ready for.

bug:8545006
Change-Id: I2cb2a7c0a1c7f3d2b81ac0f66d37346e6d2d720d

Robert Greenwalt   commited 2013-05-02 15:45:32 -07:00
7aa7bb4dfb
Update TrafficStats docs to reflect behavior.
Bug: 8399623
Change-Id: If9ccd305e8a077f318a09ac1bb160b8efbf903aa

Jeff Sharkey   commited 2013-03-26 13:46:09 -07:00
39fb9cd9c2
Add version code constant for JB MR2.
Change-Id: I60fc76bbeb3c5e85d716179e9e3ea5758bafaf69

Dianne Hackborn   commited 2013-02-25 15:55:37 -08:00
e9d7207f86
Parse network stats using native code.
Switch to parsing detailed network stats with native code, which
is 71% faster than ProcFileReader.

Change-Id: I2525aaee74d227ce187ba3a74dd08a2b06514deb

Jeff Sharkey   commited 2013-02-13 17:40:49 -08:00
51c819c4ea
Improve TrafficStats UID APIs.
Deprecate transport layer statistics, leaving only the summarized
network layer statistics.

Improve documentation to be clear about layers where measurements
occur, and their behavior since boot.  Under the hood, move to using
xt_qtaguid UID statistics.

Bug: 6818637, 7013662
Change-Id: I9f26992e5fcdebd88c671e5765bd91229e7b0016

Jeff Sharkey   commited 2013-02-07 13:59:26 -08:00
5fee2c9ee2
Offer parsed TCP interface statistics.
Also switch to newer iface_stat_fmt numbers, which are measured at
XT level instead of dev.

Bug: 7903145, 6569689
Change-Id: Ibeb742966b8c89916ea31a49388a5dbe25a5f67f

Jeff Sharkey   commited 2013-02-06 16:23:12 -08:00
9e766ac165
Fix metered SSID matching regression.
WifiInfo changed to return SSIDs with quotes included, so relax our
identity matching to accept matches regardless of quotedness.

Bug: 7695807
Change-Id: Ib5d06666035e06b2d4b2f7cb498767d63b1b1828

Jeff Sharkey   commited 2012-12-18 17:07:01 -08:00
86230aca66
Useful annotations for code documentation.
Bug: 6537978
Change-Id: I806c3c09e3255f8789455f13bf37c1dde2a93f1f

Jeff Sharkey   commited 2012-11-12 12:42:17 -08:00
526438dbe6
Sanity check network stats coming from disk.
Throw early when structure is unstable, which allows the normal
recoverFromWtf() path to recover automatically.

Bug: 7440485
Change-Id: Ic150d17daac4de7c9ff3489025403a9b485b4620

Jeff Sharkey   commited 2012-11-02 15:38:15 -07:00
3a8abe7eec
Migrate network stats from removed users.
When a user is removed, migrate all network stats belonging to that
user into special UID_REMOVED bucket.  Also removes those stats from
kernel to avoid double-counting if another user is created.

Bug: 7194784
Change-Id: I03f1d660fe3754566326b7749cae8068fc224ea9

Jeff Sharkey   commited 2012-09-19 14:54:05 -07:00
8c8309a6fe
Revert "API to adjust network stats."
Jeff Sharkey   commited 2012-07-31 17:11:07 -07:00
e1cf73eb69
API to adjust network stats. DO NOT MERGE.
Enables system apps to correctly account network usage performed on
behalf of another application.

Bug: 6695246
Change-Id: I39e243afd57936b6b30157a6ca511a17b6c55c39

Jeff Sharkey   commited 2012-07-31 11:45:17 -07:00
6615400fe8
Transition from DEV network stats to XT.
When XT stats are available, transition to prefer them over DEV,
since they aren't subject to hardware driver bugs.  Only switches at
the first atomic XT bucket, and adds a Settings.Secure flag to force
back to DEV if needed.  Includes tests to cover transition.

Fix tests where device overlay would change which network types
reflected data usage.  Test both history and summary APIs.  Fixed
collection timestamps to reflect full buckets.

Bug: 6504744
Change-Id: Idd7f3b2fdb064c36547c85c51c214fd938c59b7e

Jeff Sharkey   commited 2012-05-17 10:10:39 -07:00
3ddc9b3745
Merge "API review fixes" into jb-dev
Irfan Sheriff   authored and   Android (Google) Code Review   commited 2012-05-09 14:04:04 -07:00
0e2eb98971
API review fixes
- Remove the notion of channel from an application perspective
- Remove the use of DnsSd as part of API and add a protocol type to allow
future extensions
- Use the listener object as a handler for stop and unregister operations. Also,
we now allow multiple active discovery operations.
- Remove init/deinit operations in favour of setting up construction

Bug:6434844
Change-Id: Id15521d571aac9c4053d81184ad66dfc54f636de

Irfan Sheriff   commited 2012-05-09 11:48:42 -07:00
e4c42f4026
Reduce persist threshold for lower warning/limit.
Default is 2MB persist threshold, but even that can be substantial
for devices on 100MB/month plans. This change gradually reduces the
persist threshold up to 8x lower (256kb outstanding) based on lowest
active policy.

Bug: 5382676
Change-Id: Ief4e8cdb169bfb151a3d1b45722a8eaa01926508

Jeff Sharkey   commited 2012-05-03 12:12:10 -07:00
c78bc60039
Begin collecting xtables iface counters.
Add method to parse new iface_stat_fmt proc stats, or return null
when kernel support is unavailable. Add test and remove older, unused
parsing code. Create new "xt" recorder to persist the new xtables
counters when available.

Add SSID support to NetworkIdentity to fix policy tests.

Bug: 6422414
Change-Id: I77f70e9acb79a559ab626f3af5c4f3599801ed43

Jeff Sharkey   commited 2012-05-01 21:04:26 -07:00
cfed18ad5b
Fix build
Change-Id: I1968e0d7d25f613fa6cf72f82d79f17224e3d5ab

Irfan Sheriff   commited 2012-04-19 10:26:34 -07:00
52fc83a79a
Add network service discovery broadcast
Allows apps to know if user has the feature turned off

Change-Id: I2d2fecb148eb4e48eb4aea51d1d7643a82df5c52

Irfan Sheriff   commited 2012-04-19 09:54:40 -07:00
fb97ffe162
Add user control to turn on/off nsd
Change-Id: Ide3cc20adb21ac6dffaf6b9b9136d77a129afa3b

Irfan Sheriff   commited 2012-04-19 09:52:09 -07:00
7500665eb7
Merge "Open network service discovery API"
Irfan Sheriff   authored and   Android (Google) Code Review   commited 2012-04-17 11:39:08 -07:00
81394337bc
Merge "Move TrafficStats iface counters to xt_qtaguid."
Jeff Sharkey   authored and   Android (Google) Code Review   commited 2012-04-16 12:11:21 -07:00
f133bbfff7
Open network service discovery API
Add support for DNS based network service discovery API. This
allows applications to discover and resolve applications on a
local network such as Wi-Fi

Change-Id: Ie89895edd35d12b7f7a23fb5fed36cb2b2079f7a

Irfan Sheriff   commited 2012-04-15 17:09:48 -07:00
18da1320fe
Merge "Bonjour fixes"
Irfan Sheriff   authored and   Android (Google) Code Review   commited 2012-04-12 17:55:15 -07:00
287e63bbb6
Move TrafficStats iface counters to xt_qtaguid.
Use xt_qtaguid iface_stat_all counters, which are monotonic during
a single boot.

Track all ifaces associated with mobile networks since boot, and
move TrafficStats to using these ifaces.  This will include usage of
networks omitted from config_data_usage_network_types, specifically
on devices that recycle network interfaces across APNs.

Split wildcard template matching, and move NetworkStatsService to
use mobile wildcard when logging stats.

Bug: 5324515
Change-Id: I2211c374c05d1b598cc647f2f873630538955ffe

Jeff Sharkey   commited 2012-04-12 14:53:32 -07:00
8308b9b2af
Bonjour fixes
Change-Id: I1df1dc470bb42c84abc7e1a46bedf9f206910b65

Irfan Sheriff   commited 2012-04-12 12:08:51 -07:00
e8de246bb4
Migrate to @Override to remove warnings.
Bug: 6303344
Change-Id: I0d33b2ed448467379d576ccd71fb5ae20c878852

Jeff Sharkey   commited 2012-04-09 10:57:21 -07:00
1ba1b673f5
Splice operations before collapsing ifaces.
Bug: 6241038
Change-Id: Ide9058703f7305df8fb070af149ddce0653a0abf

Jeff Sharkey   commited 2012-04-09 10:27:55 -07:00
27421b1665
INetworkStatsSession with lifecycle for caching.
Users outside system_server now explicitly communicate their
lifecycle, which keeps a strong-reference chain to any fully loaded
NetworkStatsCollection histories.

Bug: 6236498
Change-Id: I8e22739b6e89a626b676967a736d7117fd000778

Jeff Sharkey   commited 2012-04-06 13:38:29 -07:00
920d9046bc
Support metered Wi-Fi NetworkPolicy.
Add networkId field to NetworkIdentity to identify Wi-Fi networks by
SSID.  Add support for policies without usage cycles.

Only apply mobile policies when SIM state is ready, which is cleaner
than just checking for airplane mode.  Also avoids creating no-op
default policies when subscriberId is null.

Bug: 3001465, 3291052
Change-Id: I1f8aaa49a5db306df022c402ea7f3f5d4bc0cfc7

Jeff Sharkey   commited 2012-04-05 16:02:25 -07:00
3bd888f411
Fix build
Add missing file

Change-Id: I5ed1827e1183c37741675ce4d198d3e200c5fb94

Irfan Sheriff   commited 2012-04-04 13:20:20 -07:00
f3f68819df
Add initial framework for DNS service discovery
Change-Id: I53c0b7ebfd75e520ebb7553612f1aa8413b6b79b

Irfan Sheriff   commited 2012-04-04 12:24:56 -07:00
77ec5581ed
Remove network subtype check when building template.
Change-Id: I069d82a77d27dae6bfffe3b7e65d73b63f258ad9

Jeff Sharkey   commited 2012-03-16 11:54:01 -07:00
e4474c8bfe
Combine network subtypes by default.
Subtype controls (3G-vs-4G) aren't exposed in the UI, so tracking
data with that granularity creates unnecessary overhead. For example,
some GSM networks can regularly flap between two subtypes.

Bug: 6118868
Change-Id: Id098891dba52336d00d0f96632a7924e228b4713

Jeff Sharkey   commited 2012-03-16 11:35:29 -07:00
8e38f3ddde
Move NetworkStatsFactory to faster ProcFileReader.
Less GC overhead, and about 8x faster parse times.  Verified that
tests pass.

Change-Id: Iff1d374f36103395a193176a88a57eebffa93c56

Jeff Sharkey   commited 2012-02-27 18:08:13 -08:00
be68c7c5c7
Suppress StrictMode when reading /proc/ files.
Bug: 6077051
Change-Id: If4f23e947d8b91f9f124baa0460600a6b9353732

Jeff Sharkey   commited 2012-02-27 17:42:34 -08:00
00b8bb6e79
Unify shorthand for byte-based units.
Change-Id: If990859dee3f0973e1d4c48f05312c84071b3328

Jeff Sharkey   commited 2012-02-03 14:50:13 -08:00
94a315cec5
Match WIFI_P2P data usage.
Bug: 5405891
Change-Id: I5b815d6fc25a2f26a86c39a43fde305fcc3fb65c

Jeff Sharkey   commited 2012-01-24 15:37:07 -08:00
0d038b7949
Move network stats to FileRotator pattern.
Split existing network stats into two separate classes: a recorder
which generates historical data based on periodic counter snapshots,
and a collection of historical data with persistance logic.

Recorder keeps a pending history in memory until outstanding data
crosses a specific threshold.  Persisting is handled through a given
FileRotator.  This pattern significantly reduces disk churn and
memory overhead.  Separate UID data from UID tag data, enabling a
shorter rotation cycle.  Migrate existing stats into new structure.

Remove "xt" stats until iptables hooks are ready.  Avoid consuming
Entry values when recording into NetworkStatsHistory.  Assign
operation counts to default route interface.

Introduce "Rewriter" interface in FileRotator with methods to enable
rewriteAll().  Introduce IndentingPrintWriter to handle indenting in
dump() methods.

Bug: 5386531
Change-Id: Ibe086230a17999a197206ca62d45f266225fdff1

Jeff Sharkey   commited 2012-01-24 11:13:14 -08:00
bfe82685e7
Move non-monotonic reporting to interface.
Report non-monotonic NetworkStats through an observer interface
instead of throwing, since those events are still recoverable.

Change-Id: Ic0749f4634b0ac05dbe90e95ca490957ec8b2f23

Jeff Sharkey   commited 2012-01-10 17:24:44 -08:00
ef7bded347
Include roaming in NetworkIdentity.hashCode().
Change-Id: I148d95c8d08e3916a90fa78f7efee327d4b7de2a

Jeff Sharkey   commited 2011-12-16 11:52:35 -08:00
307beecd41
Clamp non-monotonic stats instead of dropping.
When encountering non-monotonic stats rows, recover remaining data by
clamping to 0.  In particular, this avoids edge-case where persisting
threshold checks would never trigger.  Also recover when tethering
snapshots are missing.

Bug: 5600785, 5433871, 5600678
Change-Id: I1871954ce3955cc4ac8846f9841bae0066176ffe

Jeff Sharkey   commited 2011-11-10 17:54:23 -08:00
42f4043633
Merge "Bootstrap stats before registering listeners." into ics-mr1
Jeff Sharkey   authored and   Android (Google) Code Review   commited 2011-11-08 23:43:58 -08:00
35226c4c27
Bootstrap stats before registering listeners.
Also move ISE to handled NonMonotonicException.

Bug: 5570872
Change-Id: I793f349287ef5589185f117dfbec6f1fad73a661

Jeff Sharkey   commited 2011-11-08 18:24:12 -08:00
29f15bb4b3
Make operation counts monotonically increase.
Bug: 5585704
Change-Id: I5247a68acdb209a4ef0f5aac18944595c295e6ca

Jeff Sharkey   commited 2011-11-08 17:35:28 -08:00
e2de8f08d4
Correct proc file reader, optimizations.
Moved away from BufferedReader, which only reads the first 8KB of
some proc files because it aggresively fills its buffer.  Optimized
proc parsing, now double the speed.  Tests to cover.

Log when NetworkStats counters roll backwards when subtracting, and
optimizations around findIndex().  When system removes UID, also
remove from last stats snapshot to avoid xt counters from rolling
backwards.

Bug: 5472949, 5458380
Change-Id: I07c08fe5233156fac2b84450f6291868bf9bfaf2

Jeff Sharkey   commited 2011-11-02 15:14:11 -07:00
cd5559a856
Move battery stats to xt_qtaguid for data stats.
Replace TrafficStats calls by reading values from xt_qtaguid kernel
module. To keep BatteryStatsImpl changes lightweight, cache recently
parsed stats. Tracks mobile ifaces from ConnectivityService.

Refactor xt_qtaguid parsing into factory outside of NMS. Add stats
grouping based on UID, and total based on limiting filters like iface
prefix and UID.

Bug: 4902271
Change-Id: I533f116c434b77f93355bf95b839e7478528505b

Jeff Sharkey   commited 2011-10-09 13:49:08 -07:00
27f58b3e26
Refine random stats generation.
Offer parameters to pick out specific list of packages, and to change
duration and total data.

Bug: 5416742
Change-Id: I6970a5e76f3198ef23a400c079037212b000ca6b

Jeff Sharkey   commited 2011-10-05 23:31:57 -07:00
0787a3616f
Track xtables summary, move tether stats, time.
Begin tracking xtables summary of data usage to compare with values
reported from /proc/net/dev.  Roll tethering directly into UID stats
to trigger UID stats persisting when crossing threshold.

Include xtables summary and authoritative time in samples.

Bug: 5373561, 5397882, 5381980
Change-Id: Ib7945522caadfbe0864fdf391582dc820f4f371e

Jeff Sharkey   commited 2011-10-03 17:21:05 -07:00
f1369459ed
Overlay to configure data usage network types.
Specify which network types should be counted when computing data
usage totals.

Bug: 5361005
Change-Id: I830caed1a29199892d209a692b50f8b3e144cafe

Jeff Sharkey   commited 2011-09-26 10:50:30 -07:00
8cddd4a5c7