Commit Graph

5656 Commits

Author SHA1 Message Date
Chalard Jean
d5e95119ad [PT17] Small cleanup of PacManager
Test: runtest
Change-Id: I94a10cbae7f2d87bd8a68ae4f9972a728f4942c3
2018-12-20 18:25:22 +09:00
junyulai
9826e7f292 Deprecate NetworkInfo
Currently NetworkInfo is used by Apps to get information of
network. However, to get such information, Apps need to poll
NetworkInfo frequently from ConnectivityService.

In order to increase the stability and reduce the maintain
effort, all functionalities provided by NetworkInfo are targeted
to be replaced or removed entirely.

Apps should use ConnectivityManager.NetworkCallback instead, to
get faster and more detailed updates from connectivity changes.

Or, apps could use getNetworkCapabilities or getLinkProperties
to get information synchronously, but should not mix the
callbacks and synchronous methods together.

Bug: 113629330
Test: atest FrameworksNetTests
Change-Id: Ie8faf620958c3fa0a4a2f233b35b825de0e99ffc
2018-12-20 16:36:10 +08:00
jiayanhong
50b52d9db8 Merge "Fixed toString() printing error"
am: 9952ebd7d5

Change-Id: Id0f5d70a4549480fbb192628ce41796e4da04ad7
2018-12-19 09:54:46 -08:00
Treehugger Robot
9952ebd7d5 Merge "Fixed toString() printing error" 2018-12-19 17:39:58 +00:00
Paul Duffin
18b313b077 Merge "Add InetAddresses class to API"
am: 2f8a9b2c4d

Change-Id: If821b32c686fd603035050c09598384796f72fb2
2018-12-18 10:44:07 -08:00
Ken Chen
b2afafdb9c Merge "Remove 'hasDns' parameter"
am: fa9ee4fad7

Change-Id: I7efc2ff04cf65420b02ddf2cf7a13b640e37ef77
2018-12-18 10:38:59 -08:00
Paul Duffin
2f8a9b2c4d Merge "Add InetAddresses class to API" 2018-12-18 14:11:04 +00:00
Ken Chen
fa9ee4fad7 Merge "Remove 'hasDns' parameter" 2018-12-18 11:17:27 +00:00
paulhu
058120dbc2 Unhide LinkProperties, NetworkCapabilities, NetworkRequest APIs
These methods are marked to @UnsupportedAppUsage APIs since
Android Q. But some system apps still need them to set/get
necessary network or request information. Hence, make them to be
public or system APIs.

Bug: 120448492
Test: atest FrameworksNetTests
Change-Id: I95a44daef5615e290b40d0796ca183b88ad8a63f
2018-12-18 08:39:49 +00:00
Paul Duffin
70c2193096 Add InetAddresses class to API
Adds methods needed by app developers to avoid them having to call
non-SDK APIs.

Test: tests added to cts
Bug: 78686891
Change-Id: Ic0eadfdab2b111d5ca4becb753f4fe3557806433
2018-12-17 11:53:33 +00:00
Mark Chien
75bc65666e Merge "Track default upstream when system is ready"
am: 82abb83a17

Change-Id: I7febc52d94c1249b76608853d5cc142cdb8ad9df
2018-12-13 14:07:28 -08:00
Xin Li
194bd24f09 [automerger skipped] Merge "DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master"
am: 891b57de32  -s ours

Change-Id: I7710a0b1a5ba1bf7acd45d694818aec91853e546
2018-12-13 12:47:28 -08:00
Xin Li
067326b823 [automerger skipped] DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master
am: 77a7dfeb84  -s ours

Change-Id: I60ae19c5ff7d5de669fac1ebd93d48283d9f27d8
2018-12-13 11:18:53 -08:00
Mark Chien
82abb83a17 Merge "Track default upstream when system is ready" 2018-12-13 13:28:08 +00:00
markchien
529577b410 Track default upstream when system is ready
Start tracking default upstream from boot.This is useful for
entitlement refine in following change. EntitlementManager can
decide if it needs to process entitlement provisioning before
tethering started.

Test: -atest FrameworksNetTests
      -build, flash, booted
      -manually turnoff/on tethering with different upstream
bug: 111490073

Change-Id: I8fdbd64c52f26b5363693bb5bd8050930e8ea961
2018-12-13 19:01:51 +08:00
Treehugger Robot
891b57de32 Merge "DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master" 2018-12-13 05:45:20 +00:00
Etan Cohen
4e20619d98 Merge "[CM] Fix comments, add tests to TransportInfo API"
am: 4060bc1480

Change-Id: Idd668efdd1fe65754228041f23f3a91148aa38d6
2018-12-11 21:54:25 -08:00
Etan Cohen
73fb5a86f0 [CM] Fix comments, add tests to TransportInfo API
Bug: 117605977
Test: atest NetworkCapabilitiesTest
Change-Id: I734ec56e44cd09d11ae81a856a53a26e1191b9a0
2018-12-11 15:00:10 -08:00
Xin Li
77a7dfeb84 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
TreeHugger Robot
10cb63960f Merge "DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into stage-aosp-master" into stage-aosp-master 2018-12-11 21:49:22 +00:00
Junyu Lai
c28617a31f Merge "VPN: Move package intent receiver to ConnectivityService."
am: aff267369c

Change-Id: I3220f34afe7e56bcbde87a8de2b00ecddecbc97a
2018-12-11 03:36:18 -08:00
junyulai
00dd21dea8 VPN: Move package 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 VPN part by using ConnectivityService to
listen to intents and dispatch events to VPN.

Bug: 118811303
Test: 1. atest FrameworksNetTests
      2. manually add/remove package
      3. cts-tradefed run cts -m CtsHostsideNetworkTests

Change-Id: Id76fd77c5fcfb2b0e21f211f63f007b1ea1aa53f
2018-12-11 14:04:02 +08:00
Xin Li
3f2a0eb8e2 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
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
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
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
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
Hongshik
e2d7cf5aed Add PCSCF to LinkProperties.
Some applications or services are needed PCSCF address to register IMS server but there is no way to get it on Android Framework.
We have added PCSCF address to LinkProperties like attached diff files.

Test: get Linkproperties and check Pcscf addresses.
      atest FrameworksNetTests

Change-Id: Ic2341a4ce2ed88d560325721766fc21f85f7ff86
Signed-off-by: Hongshik <hshik.kim@samsung.com>
2018-12-05 22:05:49 +09: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
android-build-team Robot
1151e49dce Merge cherrypicks of [5704859, 5705300, 5704034, 5704195, 5705082, 5704058, 5704059, 5704932, 5705340, 5705341, 5705342, 5705343, 5705344, 5705361, 5705362, 5705363, 5705364, 5704870, 5704196, 5705083, 5701785, 5701786, 5701787, 5704035, 5705261, 5705281, 5704036, 5704037, 5704038, 5704871, 5704933, 5704872, 5705347, 5705262, 5704934] into pi-qpr2-release
Change-Id: Ifb7d048c4deb34b18e69173fd09e91c45980e2d9
2018-12-05 05:16:39 +00:00
junyulai
5ff6752475 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)
(cherry picked from commit e43ff3e85f)
2018-12-05 05:13:56 +00: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
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
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
5a7867d2ab Merge "PermissionMonitor: Move intent receiver to ConnectivityService."
am: 687cb5a0ed

Change-Id: I1038abba55ba5492dd8958c365500714b0e8ffd8
2018-11-26 18:07:33 -08:00