Commit Graph

1528 Commits

Author SHA1 Message Date
Adrian Roos
ef420e9754 API: Clean up redundant and ineffective usages of SystemApi and TestApi
Everything that is marked SystemApi or TestApi, but not @hide is still
part of the public SDK, it is therefore not sound to have that combination.

In the future, specifing such a combination will be considered an error
to prevent inadvertently exposing SystemApi and TestApi as public API.

Bug: 115333477
Change-Id: Ibd5d6a22862fdbc1e20a1cb3925280f5a682edea
Test: METALAVA_PREPEND_ARGS="--error UnhiddenSystemApi" m checkapi
Exempt-From-Owner-Approval: API cleanup
2018-12-11 20:38:02 +01:00
Junyu Lai
83a52f5fb2 Merge "Refactoring of deleting stats in NetworkStats based on uids." am: c8dcfb8b4b am: 2d00948a0c
am: 2d79ef94f8

Change-Id: I29c57276424464afd54e184c369d30a5e9707f14
2018-12-10 03:10:15 -08:00
Junyu Lai
2d79ef94f8 Merge "Refactoring of deleting stats in NetworkStats based on uids." am: c8dcfb8b4b
am: 2d00948a0c

Change-Id: Icfe86f71f9416dcd5fcc9aafd8c346197cde7cff
2018-12-09 21:46:07 -08:00
Junyu Lai
2d00948a0c Merge "Refactoring of deleting stats in NetworkStats based on uids."
am: c8dcfb8b4b

Change-Id: I60b086861a9a91cdd54c56c7caf21d26a6dd294a
2018-12-09 21:38:59 -08:00
Junyu Lai
c8dcfb8b4b Merge "Refactoring of deleting stats in NetworkStats based on uids." 2018-12-10 05:15:28 +00:00
junyulai
bbaddec5d7 Refactoring of deleting stats in NetworkStats based on uids.
In follow-up commits, current API would create new NetworkStats
every time when 464xlatAdjustment wants to filtered out some
uids.

This commit refactors it to delete stats in-place to get better
performance.

Bug: 118602783
Test: atest FrameworksNetTests
Change-Id: I858f95d1fa7733111786243b4e261ce8a70a068d
2018-12-06 19:01:17 +09:00
Luke Huang
1d7e968b14 Merge "Use ParcelFileDescriptor instead of FileDescriptor in INetd.aidl" am: d6c2dc5908 am: 7d5693279a
am: 0c54c1616d

Change-Id: I1dd010a0b4ec54c87b509c1e05185164fde9e4cb
2018-12-04 22:44:36 -08:00
Luke Huang
0c54c1616d Merge "Use ParcelFileDescriptor instead of FileDescriptor in INetd.aidl" am: d6c2dc5908
am: 7d5693279a

Change-Id: I8b89e88d1db96581ab91d649e5af621c499669ed
2018-12-04 22:35:32 -08:00
Luke Huang
7d5693279a Merge "Use ParcelFileDescriptor instead of FileDescriptor in INetd.aidl"
am: d6c2dc5908

Change-Id: I87360c19d58de38772f95ba8123a559007c6e71d
2018-12-04 22:21:26 -08:00
Luke Huang
d913fb44ad Use ParcelFileDescriptor instead of FileDescriptor in INetd.aidl
Stable aidl won't support FileDescriptor but ParcelFileDescriptor.
In order to migrate to stable aidl, replace all FileDescriptor in
INdetd.aidl.

Test: runtest frameworks-net passes
Change-Id: Icdf37aed0e0cce0352070a437066e77c0f2fd85a
2018-11-28 13:41:58 +08:00
Benedict Wong
a041d6fb80 Merge changes from topic "xfrmi-support" am: f928c1e4b9 am: 719761f60c
am: 0cfc49485c

Change-Id: I9c543d38c88181b12cdbc7bdb93d7e38f1dfd425
2018-11-25 19:38:35 -08:00
Benedict Wong
0cfc49485c Merge changes from topic "xfrmi-support" am: f928c1e4b9
am: 719761f60c

Change-Id: I13a826f5ae3c4cb700be789b369848685da1bc41
2018-11-25 19:26:26 -08:00
Benedict Wong
719761f60c Merge changes from topic "xfrmi-support"
am: f928c1e4b9

Change-Id: I9b76a58ab9ebdb9abb01216e8b3916f1f52f9267
2018-11-25 19:15:37 -08:00
Benedict Wong
c6fcedd779 Cleanup and update comments SA mark disabling comments
This commit cleans up and upates comments with regard to changes in
aosp/721999, clarifying the restrictions and potential pitfalls we would
see with regards to IPsec tunnel mode without updatable SAs.

Bug: 111854872
Test: Compiles, comment-only change
Change-Id: I07b0063987463c1a3cf42e112839a31739947c80
2018-11-21 22:50:52 -08:00
Benedict Wong
5d74984c24 Add XFRM-I support to IpSecService
This change adds support for XFRM-I to all IpSecService netd calls.
Fallback logic is in netd, and thus both VTI and XFRM-I parameters are
always passed down to IpSecService.

Bug: 78589502
Test: All java, CTS tests passing
Change-Id: Ie4186f0ad7e50763b21831f6fa411b5ee436de78
2018-11-21 08:34:54 -08:00
Benedict Wong
683441d87a Disable attempted updating of SA marks
SA marks are never updated during the UPDSA call. This change disables
the attempts to update the specified SAs, ensuring that the config
stored in IpSecService matches that of the allocated kernel resources.

Bug: 111854872
Test: Unit, CTS tests passing
Change-Id: Ic1fb862c8021ffa260c3e262ec698d8af0a826d9
2018-11-21 08:34:54 -08:00
Lorenzo Colitti
db7ce1e574 [automerger skipped] Merge changes from topic "sort stats" into pi-dev am: 664145dcbc -s ours
am: e6f051b6c6  -s ours

Change-Id: Ifb8171b56932ef6b7c70a0ff36ebacc4ee7801db
2018-11-16 05:56:23 -08:00
Lorenzo Colitti
e6f051b6c6 [automerger skipped] Merge changes from topic "sort stats" into pi-dev
am: 664145dcbc  -s ours

Change-Id: Iaf2d41bf8c4464e05f8733d453fcc1a168ef8323
2018-11-16 05:41:50 -08:00
Junyu Lai
11e2cb862b Merge "Change types of fields of network stats reported to framework." am: 2c0a0092f1 am: 40de2a46a3
am: 979209a2a3

Change-Id: Iab166b8b06d3a744b8cfc83e0467c478642ce185
2018-11-13 02:03:05 -08:00
Junyu Lai
979209a2a3 Merge "Change types of fields of network stats reported to framework." am: 2c0a0092f1
am: 40de2a46a3

Change-Id: I0bf2bdc56f46928b94f0954e799d51196171fdc4
2018-11-13 01:53:45 -08:00
junyulai
5a43a6735e Change types of fields of network stats reported to framework.
Currently, NetworkStats use int to handle uid, set and tag,
while native side using unsigned int mixing with signed int
with that. This commit make necessary changes in JNI part while
libnetdbpf unifying the types of fields.

Bug: 112226716
Bug: 119193941
Test: 1. manually reconnect vpn
      2. update apps from playstore
      3. atest libnetdbpf_test
      4. runtest frameworks-net
      5. cts-tradefed run cts -m CtsUsageStatsTestCases -t \
              android.app.usage.cts.NetworkUsageStatsTest

Change-Id: I6c27124db8292e2825fba51b8994f013897cb566
Merged-In: I6c27124db8292e2825fba51b8994f013897cb566
(cherry picked from commit bf7803eed8283d5a1caa2efe90aa449590ddb94f)
2018-11-13 17:44:41 +08:00
Junyu Lai
40de2a46a3 Merge "Change types of fields of network stats reported to framework."
am: 2c0a0092f1

Change-Id: I82da681df48cd6425bbfb962d3969fa236e9db29
2018-11-13 01:37:17 -08:00
junyulai
6d49d8da7e Change types of fields of network stats reported to framework.
Currently, NetworkStats use int to handle uid, set and tag,
while native side using unsigned int mixing with signed int
with that. This commit make necessary changes in JNI part while
libnetdbpf unifying the types of fields.

Bug: 112226716
Test: 1. manually reconnect vpn
      2. update apps from playstore
      3. atest libnetdbpf_test
      4. runtest frameworks-net
      5. cts-tradefed run cts -m CtsUsageStatsTestCases -t \
              android.app.usage.cts.NetworkUsageStatsTest

Change-Id: I6c27124db8292e2825fba51b8994f013897cb566
2018-11-08 23:07:00 +08:00
junyulai
3da40c4828 Fix negative uid stats caused by 464xlat adjust when eBPF is on.
When using xt_qtaguid to count per uid stats,
NetworkStatsService needs to adjust the 464xlat traffic since
iptables module would double count for ipv4 and ipv6 packet.
But for eBPF, the per uid stats is collected in a different
hook, so the adjustment on root uid would only be needed in tx
direction.

Bug: 112226716
Test: 1. Make ipv4 traffic in ipv6-only network and check data
         usage.
      2. Make ipv4 traffic in a client which connect to
         ipv6-only hotspot.
      3. runtest frameworks-net
      4. cts-tradefed run cts -m CtsNetTestCases -t \
                 android.net.cts.TrafficStatsTest
      5. cts-tradefed run cts -m CtsUsageStatsTestCases

Change-Id: Ic9a84f5446eddc943c255d5f3b89dad171f53cac
Merged-In: Ic9a84f5446eddc943c255d5f3b89dad171f53cac
(cherry picked from commit c33ac0d43b594f6154accf03ae7e3fd34dedc79d)
2018-11-07 10:16:26 +08:00
Junyu Lai
0ab82da19f Merge "Fix negative uid stats caused by 464xlat adjust when eBPF is on." am: 0d63da86e2 am: a38302f84f
am: fcb523e095

Change-Id: I9d0d8b67ed0159ba2a71059620ebe5698eb79ccb
2018-10-30 19:56:01 -07:00
Junyu Lai
fcb523e095 Merge "Fix negative uid stats caused by 464xlat adjust when eBPF is on." am: 0d63da86e2
am: a38302f84f

Change-Id: I3ee791e4b6fdd9d508807810183dc02c69bd2c0b
2018-10-30 19:46:18 -07:00
Junyu Lai
a38302f84f Merge "Fix negative uid stats caused by 464xlat adjust when eBPF is on."
am: 0d63da86e2

Change-Id: Ia5120619ce7d5cedd6e558ed4d1dc9a706638796
2018-10-30 19:35:32 -07:00
junyulai
7d412d0b46 Fix negative uid stats caused by 464xlat adjust when eBPF is on.
When using xt_qtaguid to count per uid stats,
NetworkStatsService needs to adjust the 464xlat traffic since
iptables module would double count for ipv4 and ipv6 packet.
But for eBPF, the per uid stats is collected in a different
hook, so the adjustment on root uid would only be needed in tx
direction.

Bug: 112226716
Test: 1. Make ipv4 traffic in ipv6-only network and check data
         usage.
      2. Make ipv4 traffic in a client which connect to
         ipv6-only hotspot.
      3. runtest frameworks-net
      4. cts-tradefed run cts -m CtsNetTestCases -t \
                 android.net.cts.TrafficStatsTest
      5. cts-tradefed run cts -m CtsUsageStatsTestCases

Change-Id: Ic9a84f5446eddc943c255d5f3b89dad171f53cac
2018-10-30 21:23:38 +08:00
Luke Huang
4f2898674e Merge "Refactor UidRange by using stable aidl structure" am: 55012f2249 am: 96c61c9fa2
am: 9a3586aa00

Change-Id: I82e06fe93a3ed88368b649ef8d3283322191ffe7
2018-10-28 18:06:15 -07:00
Luke Huang
9a3586aa00 Merge "Refactor UidRange by using stable aidl structure" am: 55012f2249
am: 96c61c9fa2

Change-Id: I09ac7fc6525948b76114ef936dc1b3d2d1bae0fb
2018-10-28 17:55:57 -07:00
Luke Huang
96c61c9fa2 Merge "Refactor UidRange by using stable aidl structure"
am: 55012f2249

Change-Id: I9ac52f3869fe051d0ef7f45768f1defad155b53b
2018-10-28 17:44:20 -07:00
Treehugger Robot
55012f2249 Merge "Refactor UidRange by using stable aidl structure" 2018-10-29 00:17:34 +00:00
Olivier Gaillard
7456dd9539 Merge "Update a few runnable/handler to use a static class instead of a runnable." 2018-10-26 08:05:30 +00:00
Xiangyu/Malcolm Chen
4ead2b6b84 [automerger skipped] Merge changes into pi-dev-plus-aosp
am: ace6d6fc61  -s ours

Change-Id: Id2d191ae22884f4380c087ec2aebe7bbbe180e5c
2018-10-25 22:52:45 -07:00
Bill Yi
7034246041 [automerger skipped] Merge pie-platform-release to aosp-master - DO NOT MERGE am: 567b439367 -s ours am: 13a634886b -s ours
am: f91213f1f5  -s ours

Change-Id: I75b649236c9bc42d627dd79d055e38b26e20fa40
2018-10-25 21:14:17 -07:00
Bill Yi
42384c6e04 [automerger skipped] Merge pi-platform-release to stage-aosp-master - DO NOT MERGE am: ef4374f6a2 -s ours
am: 51a3f72bbb  -s ours

Change-Id: Ibe80ad8a60c74e954623c543607573491754cd2e
2018-10-25 20:12:57 -07:00
Android Build Merger (Role)
ace6d6fc61 Merge changes into pi-dev-plus-aosp 2018-10-26 02:59:16 +00:00
Bill Yi
f91213f1f5 [automerger skipped] Merge pie-platform-release to aosp-master - DO NOT MERGE am: 567b439367 -s ours
am: 13a634886b  -s ours

Change-Id: If860aa9619b4655886dfdac1528940e5e30446fe
2018-10-24 19:40:40 -07:00
Bill Yi
51a3f72bbb [automerger skipped] Merge pi-platform-release to stage-aosp-master - DO NOT MERGE
am: ef4374f6a2  -s ours

Change-Id: If3b4a8fabee7b9b74e345d59505040e45588f9e7
2018-10-24 17:20:17 -07:00
Bill Yi
13a634886b [automerger skipped] Merge pie-platform-release to aosp-master - DO NOT MERGE
am: 567b439367  -s ours

Change-Id: I2c4b9184789a1bdae2cec06e0e72f6c6ca049113
2018-10-24 17:17:46 -07:00
Bill Yi
567b439367 Merge pie-platform-release to aosp-master - DO NOT MERGE
Change-Id: I695db52f5e22509401258e8b083e7650d401d993
2018-10-24 14:48:44 -07:00
Bill Yi
ef4374f6a2 Merge pi-platform-release to stage-aosp-master - DO NOT MERGE
Change-Id: I13571b072111900d0979f026670e648cdef9899b
2018-10-24 09:08:38 -07:00
Luke Huang
e67f2178dc Refactor UidRange by using stable aidl structure
Use stable aidl generated structure instead of UidRange

Test: runtest frameworks-net passes
Test: manual testing of UidRange related function works
Change-Id: Iaf1c10777dc1e71df2be2a57533a10257b12626b
2018-10-24 19:45:09 +09:00
Olivier Gaillard
ff57484594 Update a few runnable/handler to use a static class instead of a
runnable.

It will help collecting better data for handler stats (we can get a
fully qualified class name).

Test: tested manually
Change-Id: I674cf03909153fd87d97f600e246e04800cbb624
2018-10-24 10:18:35 +01:00
Chalard Jean
2ca6ac1f1c [automerger skipped] Merge "Delay global alerts by 1s for high thresholds" into pi-dev am: 688358e870 -s ours
am: 2d9ee8173a  -s ours

Change-Id: I8343d023ec9584b2a592114e51d588a4c67d83e9
2018-10-19 03:08:06 -07:00
Chalard Jean
2d9ee8173a [automerger skipped] Merge "Delay global alerts by 1s for high thresholds" into pi-dev
am: 688358e870  -s ours

Change-Id: I61187439899450e20f4a1fb7490fff202b60be29
2018-10-19 02:58:01 -07:00
Chenbo Feng
9a7e9521fd Merge "Move bpf project to system/bpf" am: 1006d271cc am: d271be0e1c
am: e6278480b9

Change-Id: I4126f4e184975a387a82ada2b4f432cf20cabbb8
2018-10-18 09:13:56 -07:00
Chenbo Feng
e6278480b9 Merge "Move bpf project to system/bpf" am: 1006d271cc
am: d271be0e1c

Change-Id: I9c0592365844836dc644d6e090def32af3edf678
2018-10-18 08:12:41 -07:00
Chenbo Feng
d271be0e1c Merge "Move bpf project to system/bpf"
am: 1006d271cc

Change-Id: I0a96a2abd66fd0cca4b49d773a6990a59134128a
2018-10-17 13:55:43 -07:00
Chenbo Feng
4a259ab940 Move bpf project to system/bpf
The bpf project now have a new project directory in system/bpf instead
of inside netd. The network related bpf library is renamed to
libnetdbpf. Fix the dependency issue in framework to make sure no
regression.

Test: -m CtsNetTestCases -t android.net.cts.TrafficStatsTest
Bug: 112334572
Change-Id: Ibd477bf17d18d516aa520fb1569f4a395ef9abf0
2018-10-17 03:46:35 +00:00