Commit Graph

1503 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
ff1f9b78d4 Merge changes I1250730c,I7d00848c am: e693d49c0a
am: fef17fd05f

Change-Id: I31c9f6c11d0f52a34f68151fc2baca1921dcadad
2019-01-23 08:40:50 -08:00
Remi NGUYEN VAN
fef17fd05f Merge changes I1250730c,I7d00848c
am: e693d49c0a

Change-Id: I2f19490a2340bdc2630162dfe9a277dffc5041fa
2019-01-23 08:26:33 -08:00
Remi NGUYEN VAN
63e61c427d Move IpClient to NetworkStack
Test: atest FrameworksNetTests NetworkStackTests
Bug: b/112869080
Change-Id: I7d00848c052382cd1b6ce458868bed6a1e9e8ec5
2019-01-23 16:44:21 +09:00
junyulai
b05c88fbf0 Merge "resolve merge conflicts of da290bec0c5418e758b92abad7be8e729cf37d68 to stage-aosp-master" into stage-aosp-master
am: 2c811e8843

Change-Id: Ibdbccc7b205677c9f3e7b0b876c13c83c0c51a70
2019-01-21 10:53:47 -08:00
junyulai
19ec97e903 resolve merge conflicts of da290bec0c5418e758b92abad7be8e729cf37d68 to stage-aosp-master
Bug: None
Test: I solemnly swear I tested this conflict resolution.

Change-Id: I719965f13d1f726fdac5b475fd8733b07e28f5b6
Merged-In: I3d94acb71c142ec38b750e58822881ff383341cc
2019-01-21 12:22:13 +00:00
Mike SU
3657ce9690 fix getIfaceStats and getTotalStats bug
root cause: getIfaceStats and getTotalStats is directly reading
iface_stat_fmt or eBPF, not include tether stats.
solution: add tether stats to getIfaceStats and getTotalStats.

Bug: 120039819
Test case1:
1. tether offload is enabled on phone, enable MHS on phone.
2. Use test app to check getMobileRxBytes->getIfaceStats
3. Download 10M file on MHS client
4. Use test app to check getMobileRxBytes->getIfaceStats again
result: getMobileRxBytes increased around 10M

Test case2:
1. tether offload is disabled on phone, enable MHS on phone.
repeat above step 2~4
result: getMobileRxBytes increased around 10M

Following CTS cases passed
run cts -m CtsNetTestCases --test android.net.cts.TrafficStatsTest
run cts -m CtsUsageStatsTestCases --test android.app.usage.cts.NetworkUsageStatsTest

Change-Id: I3d94acb71c142ec38b750e58822881ff383341cc
2019-01-10 12:16:25 -06:00
Chenbo Feng
50252f86f3 Merge "Adjust map names due to new bpfloader" am: 0317e9e374
am: 37cec67bdc

Change-Id: I28a2e41a354abdd8b2113c927a6489ea8710b431
2019-01-09 11:15:44 -08:00
Chenbo Feng
37cec67bdc Merge "Adjust map names due to new bpfloader"
am: 0317e9e374

Change-Id: If97a15a7f7b6a066bbf46db3497270a8c9a81026
2019-01-09 10:53:22 -08:00
Treehugger Robot
0317e9e374 Merge "Adjust map names due to new bpfloader" 2019-01-09 18:34:49 +00:00
junyulai
fa29021fb7 [automerger skipped] Merge "DO NOT MERGE: Revert: use legacy way to get tcp packet count" am: a1e93d0a66 -s ours
am: ac828b9ad4 -s ours
am skip reason: subject contains skip directive

Change-Id: I3c3a25cd81aaff1a4d5ac7e5d4db9a03ea8f9d84
2019-01-08 21:24:13 -08:00
junyulai
ac828b9ad4 [automerger skipped] Merge "DO NOT MERGE: Revert: use legacy way to get tcp packet count"
am: a1e93d0a66 -s ours
am skip reason: subject contains skip directive

Change-Id: I3b55e5cac6168719dc586013707c8d270b148206
2019-01-08 21:19:09 -08:00
Treehugger Robot
a1e93d0a66 Merge "DO NOT MERGE: Revert: use legacy way to get tcp packet count" 2019-01-09 05:10:05 +00:00
junyulai
579bf97659 DO NOT MERGE: Revert: use legacy way to get tcp packet count
In Q, legacy way to get tcp packet count is not planned to be
supported. Users who use this unsupported API e.g., data stall
detection are also planned to be removed.

Thus, this change reverts 0b4a66a1c2 which is the short term
solution in P.

Bug: 110443385
Test: atest FrameworksNetTests
Change-Id: Ia09f908edbf194b9aa873a3bdd5aee7b6fcb16bc
2019-01-09 10:38:32 +08:00
Chenbo Feng
150dc6f187 Adjust map names due to new bpfloader
With the new loader support added. The bpf map format is defined by bpf
kernel program as well. Change the netd bpf program to the new format.

Test: CtsUsageStatsTestCases
Bug: 112334572
Change-Id: I34e38e0a8cf0cca54dc52ec897771452f9d90525
2019-01-04 12:06:35 -08:00
Junyu Lai
59c7f1a494 Merge "Ignore ipv6 tx traffic on clat uid." am: 191f32fdc7
am: 9c0075aad0

Change-Id: I0f289ce46462f494adb99628bd504cafb584eeeb
2019-01-04 08:30:44 -08:00
Junyu Lai
9c0075aad0 Merge "Ignore ipv6 tx traffic on clat uid."
am: 191f32fdc7

Change-Id: I181c3c812caa9bcd359fbddf74d14adeb7e83419
2019-01-04 08:13:29 -08:00
Junyu Lai
191f32fdc7 Merge "Ignore ipv6 tx traffic on clat uid." 2019-01-04 09:29:10 +00:00
Xin Li
9144380565 [automerger skipped] Merge "DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master" am: ab3b396c45 -s ours
am: c8c0caf117  -s ours

Change-Id: I4988e15e6b919c6d237706dc578631c1cf9cc1fa
2018-12-13 13:01:05 -08:00
Xin Li
c8c0caf117 [automerger skipped] Merge "DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master"
am: ab3b396c45  -s ours

Change-Id: I7710a0b1a5ba1bf7acd45d694818aec91853e546
2018-12-13 12:47:28 -08:00
Xin Li
a437ec6cbb [automerger skipped] DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master am: 6f9c73f8c9 -s ours
am: 964a5fb469  -s ours

Change-Id: Icf77675866d843c8d6d5cc30ea1a5f1d8f0cfba7
2018-12-13 12:16:11 -08:00
Xin Li
964a5fb469 [automerger skipped] DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master
am: 6f9c73f8c9  -s ours

Change-Id: I60ae19c5ff7d5de669fac1ebd93d48283d9f27d8
2018-12-13 11:18:53 -08:00
Chenbo Feng
6f97b16072 Merge "Delete unused import" am: e726c2654d
am: 76b4d2fba2

Change-Id: Ia8e3487aeb24129fce0ed55c9965809c7e3d87cd
2018-12-12 22:32:11 -08:00
Chenbo Feng
76b4d2fba2 Merge "Delete unused import"
am: e726c2654d

Change-Id: I8249bd4340b6e6e2e0a4fa687207198b534168b1
2018-12-12 22:18:40 -08:00
Treehugger Robot
ab3b396c45 Merge "DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master" 2018-12-13 05:45:20 +00:00
Chenbo Feng
f9eff38d9b Delete unused import
The hasBpfSupport() check from BpfUtils is not used by the native helper
in framework. Remove them.

Bug: 111441138
Test: Build without failure.
Change-Id: Icdd01bf1a03efd7883e4939d0d730303ec1004e7
2018-12-13 00:46:20 +00:00
Adrian Roos
a58161f70f Merge "API: Clean up redundant and ineffective usages of SystemApi and TestApi" am: af0e1c2fa5
am: ee2ba33204

Change-Id: I2251db66ef73d5b69c84b4e83f2788d2bc953eda
2018-12-12 08:44:43 -08:00
Adrian Roos
ee2ba33204 Merge "API: Clean up redundant and ineffective usages of SystemApi and TestApi"
am: af0e1c2fa5

Change-Id: I016cacee1e1de6c7a8269fc3605ed25716598d9e
2018-12-12 08:33:17 -08:00
Adrian Roos
be53fbb8d5 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
Merged-In: Ibd5d6a22862fdbc1e20a1cb3925280f5a682edea
Test: METALAVA_PREPEND_ARGS="--error UnhiddenSystemApi" m checkapi
Exempt-From-Owner-Approval: API cleanup
2018-12-12 15:02:26 +01:00
Xin Li
659576f54f [automerger skipped] DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into stage-aosp-master
am: 07ea8a407d  -s ours

Change-Id: I81786efa9a194dad95d2a1ee079b1915ea26abd2
2018-12-11 15:04:45 -08:00
Xin Li
6f9c73f8c9 DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master
Bug: 120502534
Change-Id: Idc8bfb6d97a869b76cfb87ca1a494201baf9e8bd
2018-12-11 14:13:44 -08:00
Xin Li
07ea8a407d DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into stage-aosp-master
Bug: 120502534
Change-Id: I7351a1832c4bd2fd86324183ab83e9088d716822
2018-12-10 12:30:19 -08:00
junyulai
6fe079615b Ignore ipv6 tx traffic on clat uid.
Currently, 464xlat counts its ipv6 tx traffic into root uid.
When user is making ipv4 upload over ipv6-only network, ipv4
tx traffic may sometimes be counted faster then ipv6 tx
traffic.

Thus, NetworkStatsService may detect non-monotonic values due
to 464xlat adjustment.

So the solution is that: for clatd, make ipv6 tx traffic counts
into clat uid, and then ignore it in the framework side.

Bug: 118602783
Test: 1. manually verify clatd traffic on clat uid.
      2. runtest frameworks-net

Change-Id: Ifb478b79e3e281918c70e16d1f90682c78f33db1
2018-12-10 15:19:03 +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
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
Bill Yi
d5fda04e91 Merge pi-qpr1-release PQ1A.181105.017.A1 to pi-platform-release
Change-Id: Id08fdcae21e3ceb54e893a9ed11da6e67c889895
2018-11-28 18:45:59 -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
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
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
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