Commit Graph

5505 Commits

Author SHA1 Message Date
junyulai
879dbfa624 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
bc661e2a6e Merge "Refactoring of deleting stats in NetworkStats based on uids." am: 12924cb23b
am: f348c8d8a9

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

Change-Id: I60b086861a9a91cdd54c56c7caf21d26a6dd294a
2018-12-09 21:38:59 -08:00
Junyu Lai
12924cb23b Merge "Refactoring of deleting stats in NetworkStats based on uids." 2018-12-10 05:15:28 +00:00
Etan Cohen
7e32ea6593 Merge "[CS] Add a generic transport-specific information API" am: 0e18882d5c
am: 7081aa381d

Change-Id: If70fb160c90afbfb646ca7474d06fe735031aed5
2018-12-08 20:19:32 -08:00
Etan Cohen
7081aa381d Merge "[CS] Add a generic transport-specific information API"
am: 0e18882d5c

Change-Id: Ibd5c44ff35a9002f2eafe0f0f131dbdb609f50a9
2018-12-08 20:09:11 -08:00
Etan Cohen
0e18882d5c Merge "[CS] Add a generic transport-specific information API" 2018-12-09 03:53:44 +00:00
Etan Cohen
ac07cca084 [CS] Add a generic transport-specific information API
Add a generic transport-specific information container interface and
access methods. These can be used by a network factory to pass transport
(bearer)-specific network parameters to the app.

Bug: 117605977
Test: atest frameworks/base/tests/net/java/android/net (+new unit tests)
Change-Id: Ib7c83b677e1c02a2212265719813e648b0c9cc1b
2018-12-07 17:37:48 +00:00
Chenbo Feng
df92513813 Merge "Call netd to update the tcp buffer size" am: a3713ac30d
am: 80cf8a0c40

Change-Id: Ib7ab6171d6bc15b2ab8e874eeaafe79f0b8cc4b5
2018-12-06 11:37:33 -08:00
Chenbo Feng
80cf8a0c40 Merge "Call netd to update the tcp buffer size"
am: a3713ac30d

Change-Id: I217b1cc4afd886b449e532a7bde26bc9a5167277
2018-12-06 11:16:18 -08:00
Treehugger Robot
a3713ac30d Merge "Call netd to update the tcp buffer size" 2018-12-06 19:01:24 +00:00
junyulai
edb60c461b 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
cken
586a6f2002 Remove 'hasDns' parameter
Netd use this parameter to determine which network it should use for
DNS query when VPN is enabled. But it is no more reliable when we have
seamless vpn handover, since the parameter does not make update to
netd if we have DNS configuration change. Netd should call resolver
API to get latest DNS information rather than this one.

Bug: 116539103
Test: runtest frameworks-net passes
Change-Id: I6491114ab6de0ff66322f1da69056e6f3c999b5a
2018-12-06 10:25:28 +09:00
Luke Huang
83ab6ba827 Merge "Use ParcelFileDescriptor instead of FileDescriptor in INetd.aidl" am: 1038ffef1b
am: 74b4d20c28

Change-Id: I8b89e88d1db96581ab91d649e5af621c499669ed
2018-12-04 22:35:32 -08:00
Luke Huang
74b4d20c28 Merge "Use ParcelFileDescriptor instead of FileDescriptor in INetd.aidl"
am: 1038ffef1b

Change-Id: I87360c19d58de38772f95ba8123a559007c6e71d
2018-12-04 22:21:26 -08:00
Luke Huang
1038ffef1b Merge "Use ParcelFileDescriptor instead of FileDescriptor in INetd.aidl" 2018-12-05 05:55:49 +00:00
Lucas Lin
3cf08592d6 Merge "Simpify logic in updateTcpBufferSizes" am: 08d5bca515
am: 7aa3fe1ebd

Change-Id: I0cfb5c96efb2ddca14013d1f15125b117cfbaf7d
2018-11-29 01:11:05 -08:00
Lucas Lin
7aa3fe1ebd Merge "Simpify logic in updateTcpBufferSizes"
am: 08d5bca515

Change-Id: Ia95fd298cdea4b47cc9842b63f11282de58d18f7
2018-11-29 00:55:52 -08:00
Bill Yi
94335ab16f Merge pi-qpr1-release PQ1A.181105.017.A1 to pi-platform-release
Change-Id: Id08fdcae21e3ceb54e893a9ed11da6e67c889895
2018-11-28 18:45:59 -08:00
lucaslin
821c97863f Simpify logic in updateTcpBufferSizes
updateTcpBufferSizes() only need tcp buffer size as its
parameter. Also unify the logic to check default network
outside the function.

Bug: 120119769
Test: 1. Build pass.
      2. runtest frameworks-net

Change-Id: Iee9fec3efe7d5be5b590dd1c1f67ec5de636e613
2018-11-29 01:35:54 +00:00
Lucas Lin
41a9572c55 Merge "Update LinkProperties to NetworkAgentInfo only when it's changed" am: 0683c607b6
am: 8862ea3337

Change-Id: I013f7150221d5f8fd53c7d21ca42c865103f8bb9
2018-11-28 02:35:52 -08:00
Lucas Lin
8862ea3337 Merge "Update LinkProperties to NetworkAgentInfo only when it's changed"
am: 0683c607b6

Change-Id: I681eaea9dfccaef5c0f003c2cef7721539f7328c
2018-11-28 02:22:50 -08:00
Lucas Lin
0683c607b6 Merge "Update LinkProperties to NetworkAgentInfo only when it's changed" 2018-11-28 09:57:48 +00:00
lucaslin
74fa397f15 Update LinkProperties to NetworkAgentInfo only when it's changed
In previous design, it will always assign newLp to nai in
handleUpdateLinkProperties(). And Private dns configuration
will be missing when the same LinkProperties are updated
because the updated LinkProperties is not assigned back to
NetworkAgentInfo.

Bug: 118518971
Test: 1.Build pass.
      2.runtest frameworks-net

Change-Id: I405c8f29497fec438082a2cf30eb5c7b9497e1c4
2018-11-28 06:16:38 +00:00
Luke Huang
a904fab046 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
Chiachang Wang
68ef724234 Merge "Data stall detection using DNS event" am: 45c772fabc
am: aad60e773d

Change-Id: I35e7e81fa0d6db6527ea6dd606d00046df3b9818
2018-11-27 20:18:54 -08:00
Chiachang Wang
aad60e773d Merge "Data stall detection using DNS event"
am: 45c772fabc

Change-Id: I4b5248e97028bf8e9e837ff5ccf8e0d3138f7b05
2018-11-27 20:09:03 -08:00
Chiachang Wang
45c772fabc Merge "Data stall detection using DNS event" 2018-11-28 03:53:30 +00:00
Chenbo Feng
1541629a3f Call netd to update the tcp buffer size
The system server is controlling the tcp buffer now by writing to
/sys/kernel/ipv4/tcp_{rmem,wmem}_{min,def,max}. Those files are
basically the same as /proc/sys/net/ipv4/tcp_{rmem,wmem} except those
latter ones contain all three values in one file. Netd can directly write
to those files so we no longer need to depend on these android specific
files.

Test: netd_integration_test
Bug: 118572798
Change-Id: I588b48be29ecf61fd5bbf94f97f63738be4eae25
2018-11-27 15:37:52 -08:00
Chiachang Wang
686e7c02e0 Data stall detection using DNS event
If dns resolver on a network get consecutively timeout then it
is a strong signal that the network is no longer usable.
Reevaluate the network once it's data stall suspected

Test: 1. runtest frameworks-net
      2. SettingsBackupTest passes
      2. Run on wifi w/o internet capability
Bug: 112653893, 113916551

Change-Id: I74287b174d933f97a91fa1529b1809856ac3b38d
2018-11-27 18:00:05 +08:00
Junyu Lai
4cd28d5f14 Merge "PermissionMonitor: Move intent receiver to ConnectivityService." am: 687cb5a0ed
am: 5a7867d2ab

Change-Id: I912c27bcae04fc6ed040fe02522911c3ddbecd30
2018-11-26 18:27:38 -08:00
Junyu Lai
5a7867d2ab Merge "PermissionMonitor: Move intent receiver to ConnectivityService."
am: 687cb5a0ed

Change-Id: I1038abba55ba5492dd8958c365500714b0e8ffd8
2018-11-26 18:07:33 -08:00
Junyu Lai
687cb5a0ed Merge "PermissionMonitor: Move intent receiver to ConnectivityService." 2018-11-27 01:48:59 +00:00
Benedict Wong
b71b2aefef Merge changes from topic "xfrmi-support" am: f928c1e4b9
am: 4b7bb9f374

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

Change-Id: I9b76a58ab9ebdb9abb01216e8b3916f1f52f9267
2018-11-25 19:15:37 -08:00
jiayanhong
a03720b3e9 Fixed toString() printing error
There maybe some copy paste error about mNetworkCapabilities
and mUnwantedNetworkCapabilities in NetworkCapability#toString()

Test: manual + CodeDEX scan
Change-Id: I9997163e8b557590c27d15f0b2184ce6e1a53647
2018-11-23 14:23:04 +08:00
Benedict Wong
12b70569f9 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
junyulai
df46b35279 PermissionMonitor: Move intent receiver to ConnectivityService.
Currently, PermissionMonitor listen to user add/remove and
package add/remove intent respectively, and so does VPN.
Thus, races might occurr between them.

This commit refactor PermissionMonitor part by using
ConnectivityService to listen to intents and dispatch events
to PermissionMonitor.

Bug: 118811303
Test: 1. atest FrameworksNetTests
      2. manually add/remove package

Change-Id: I6e45b5870d5b1300cad252d25bdb4da78f9bf70e
2018-11-21 12:17:10 +09:00
Jack Yu
e8c1f1222c Merge "Move hidden APIs into system APIs" am: c606db86c8
am: 44676f50d4

Change-Id: Ibe6fa27d99791e57b1253a9dc990de0706b52fb6
2018-11-20 19:04:24 -08:00
Jack Yu
44676f50d4 Merge "Move hidden APIs into system APIs"
am: c606db86c8

Change-Id: Ic35d305ce0a7e6d0472bfe76ee00034abdd918c5
2018-11-20 18:56:13 -08:00
Jack Yu
c606db86c8 Merge "Move hidden APIs into system APIs" 2018-11-21 02:40:30 +00:00
Etan Cohen
79e553dea6 Merge "Add IPv6 link-local address generation from EUI-48" am: fb0dcb1ed7
am: e6db899061

Change-Id: I63de4fa185649d9389a771860c479899e90b37e4
2018-11-19 16:48:22 -08:00
Etan Cohen
e6db899061 Merge "Add IPv6 link-local address generation from EUI-48"
am: fb0dcb1ed7

Change-Id: I463cc804b21c99512e506b60a44cd62732d3c2b2
2018-11-19 16:38:06 -08:00
Etan Cohen
fb0dcb1ed7 Merge "Add IPv6 link-local address generation from EUI-48" 2018-11-20 00:19:54 +00:00
Jack Yu
2268041efb Move hidden APIs into system APIs
To allow vendor code to construct LinkAddress, which is
one of the parameter in the system API DataCallResponse.

Test: Build
Bug: 73659459
Merged-In: I3e203781d3a03285fa0e047cc8837ccb4a09016a
Change-Id: I3e203781d3a03285fa0e047cc8837ccb4a09016a
2018-11-19 14:40:13 -08:00
Remi NGUYEN VAN
4c1318c162 Merge "(Really) fix LingerMonitor rate limiting" am: cf33708bcd
am: e668ae16bc

Change-Id: I55d69d0bf1102b4159db5ffb4a37684f7a676008
2018-11-18 23:40:38 -08:00
Remi NGUYEN VAN
e668ae16bc Merge "(Really) fix LingerMonitor rate limiting"
am: cf33708bcd

Change-Id: I3b03f5985137a57e7c3ed3b2e0030078a4ea676d
2018-11-18 23:26:25 -08:00
Treehugger Robot
cf33708bcd Merge "(Really) fix LingerMonitor rate limiting" 2018-11-19 07:14:11 +00:00
Etan Cohen
ec1c466cb0 Add IPv6 link-local address generation from EUI-48
Add a utility method to convert an EUI-48 to an IPv6 link-local
address based on RFC 4291 (EUI-64 generation) followed by RFC 4862.

Bug: 117605977
Test: atest MacAddressTest
Merged-In: I80b683e69da6beff3b37fc345fc15aa9610d09b7
Change-Id: I80b683e69da6beff3b37fc345fc15aa9610d09b7
2018-11-16 21:50:24 -08:00
Lorenzo Colitti
0813f8c4ea [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