Commit Graph

1139 Commits

Author SHA1 Message Date
Paul Hu
9acc3e21d1 Merge "Fix Automated API Review issues." am: e9109ceb23 am: fa662c4b91
am: 67646b0f22

Change-Id: Iba1630161579571d4975aba9bbd5c767f82c8a98
2019-03-21 11:54:51 -07:00
Paul Hu
e9109ceb23 Merge "Fix Automated API Review issues." 2019-03-21 17:19:26 +00:00
lucaslin
372cc04dc3 Merge "Temporarily disable flaky test." am: d2ff961201 am: ead65ee6f8
am: c20c0bd4d9

Change-Id: I583ed9aa0e42e864ef0c1e74fbcd9357e093cc25
2019-03-21 08:39:31 -07:00
Treehugger Robot
d2ff961201 Merge "Temporarily disable flaky test." 2019-03-21 15:04:15 +00:00
Mark Chien
fc638407f2 Merge "Replace TcpSocketInfo with similar structure" am: 19a71f90e4 am: 192c20eed5
am: bd4c1878c3

Change-Id: I9b51e6905245ada2707ef7498cc1b8e4cb4c69a0
2019-03-21 05:35:15 -07:00
Mark Chien
19a71f90e4 Merge "Replace TcpSocketInfo with similar structure" 2019-03-21 12:02:54 +00:00
lucaslin
0f755c31a5 Temporarily disable flaky test.
Test: None
Bug: 128426024
Change-Id: I6fa12e50decbafe9d934030865c5a8f20d42b86f
2019-03-21 19:14:32 +08:00
Luke Huang
d7a9b23429 Merge "Cleanup NetworkManagementService for Netd commnads binder migrartion" am: cfd6cdf447 am: f3b2546131
am: df6794ca21

Change-Id: Ib6730d87eeebcd82964feeb96d12c09ae652d0d5
2019-03-20 23:40:30 -07:00
Luke Huang
cfd6cdf447 Merge "Cleanup NetworkManagementService for Netd commnads binder migrartion" 2019-03-21 06:01:25 +00:00
paulhu
9bb0480c2a Fix Automated API Review issues.
1. Some API's argument/return value must be marked either
@NonNull or @Nullable.
2. Change some system APIs to public APIs.
3. Modify the method name

Bug: 126700123
Bug: 126702339
Bug: 126699682
Bug: 118296575
Bug: 126699216
Bug: 126699675
Bug: 126699429
Bug: 126699193
Bug: 123586045
Test: atest FrameworksNetTests
Change-Id: Iaa2832cdcf83758ed0fec81b954a0c63bc5a7bf6
2019-03-21 13:55:37 +08:00
Lucas Lin
59bab9709f Merge "Improve partial connectivity" am: ce8235772b am: 8f78c70595
am: 7e756a45cd

Change-Id: I25f9d056c26bf947c2e09516da51b627c3da9685
2019-03-20 21:15:34 -07:00
Lucas Lin
ce8235772b Merge "Improve partial connectivity" 2019-03-21 03:34:30 +00:00
markchien
0fcb07885b Replace TcpSocketInfo with similar structure
Replace TcpSocketInfo with TcpKeepalivePacketDataParcelable
because their structures are very similar.

bug: 128882321
Test: -build, flash, boot
      -FrameworksNetTests

Change-Id: Iafb4031a64ba4775a495c156e2c997d890c6b261
2019-03-20 22:29:48 +08:00
Luke Huang
c5fdf01476 Cleanup NetworkManagementService for Netd commnads binder migrartion
remove dead code used for netd UNIX sokcet

Bug: 65862741
Test: atest NetworkManagementServiceTest FrameworksNetTests
Change-Id: I5db61cb86325b71ac8a8fce7b15dbf569abc5935
2019-03-20 20:02:24 +08:00
lucaslin
2afb4bcbcb Improve partial connectivity
Improve the design and fix some nits.

Bug: 113450764
Test: 1. Build pass
      2. atest FrameworksNetTests
      3. atest NetworkStackTests
      4. Change captive_portal_https_url to https://invalid.com
      to simulate partial connectivity.
Change-Id: Ia56645841d00d2ed8406cfeacb86a4a27fd58650
2019-03-20 18:21:59 +08:00
Remi NGUYEN VAN
b03aada33f Merge "Add Parcelable implementation for ApfCapabilities" am: 9a35341fe2 am: 78d8ff6bf8
am: 887c5f639d

Change-Id: I4d878b8dc0928aca47f944050becaa4d5206e336
2019-03-19 18:09:23 -07:00
Remi NGUYEN VAN
9a35341fe2 Merge "Add Parcelable implementation for ApfCapabilities" 2019-03-20 00:34:53 +00:00
Varun Anand
fb2624d4f3 Merge "Add unit tests related to data accounting for VPNs with one underlying network." am: 0572cf6752 am: 42db9375aa
am: fefcada377

Change-Id: I80e3ebb556ac0b6bff5d232b881f7d869cb74f00
2019-03-19 09:47:04 -07:00
Treehugger Robot
0572cf6752 Merge "Add unit tests related to data accounting for VPNs with one underlying network." 2019-03-19 16:18:28 +00:00
Xiao Ma
2ffddfd7e4 Merge "Move the IpMemoryStore to the network stack." am: 3b3aabfb68 am: e0f77826f7
am: f693b45d57

Change-Id: I243056012d2f099d96a33657c0eb63a5b66a2cfe
2019-03-19 06:54:43 -07:00
Chalard Jean
0727435c56 Move the IpMemoryStore to the network stack.
Test: atest FrameworksNetTests
Change-Id: Ic5bd6ff54b09a6fa92b6863f240a5b053011acb6
2019-03-18 11:33:17 +09:00
Remi NGUYEN VAN
bd87531730 Merge "Remove NetworkParcelable" am: 7391d04a26 am: 7dc93f8a1e
am: f363d924dc

Change-Id: Ifec0dd683bf9c9b73c4af12835b76d284559daf8
2019-03-17 19:12:02 -07:00
Remi NGUYEN VAN
7391d04a26 Merge "Remove NetworkParcelable" 2019-03-18 01:30:25 +00:00
Varun Anand
e22525bf92 Add unit tests related to data accounting for VPNs with one underlying
network.

This is to establish a baseline for the existing behavior, and to ensure
that following changes are not causing a regression in existing
behavior.

This CL is also adding missing cleanup for NetworkStatsCollectionTest
which was forcing all network types in NetworkTemplate that was causing
NetworkStatsService related tests to fail.

Bug: 113122541
Bug: 120145746
Test: atest FrameworksNetTests
Change-Id: I285f186cfb16bc9fa704c797996b1e4f8a73dee4
2019-03-15 17:23:28 -07:00
Remi NGUYEN VAN
633c331167 Remove NetworkParcelable
With the @JavaOnlyStableParcelable annotation, Network can now be used
as-is as a framework parcelable.

Test: atest FrameworksNetTests NetworkStackTests
Bug: 126477266
Change-Id: I5d9695a31b3ac48d10edcf08ccd0c34375353b79
2019-03-16 03:51:09 +09:00
Junyu Lai
6c1a593fef Merge "[KA02.5] Use binder thread and executor to invoke callback" am: f9ae70a41c am: 750fbd0ab2
am: 686be8c9b0

Change-Id: I881c1ab09187ab23facc03bb71cc38a7978e442c
2019-03-15 01:19:55 -07:00
Remi NGUYEN VAN
619010079e Add Parcelable implementation for ApfCapabilities
This is necessary to allow usage of ApfCapabilities as-is in AIDL,
instead of relying on ApfCapabilitiesParcelable, assuming that stable
AIDL starts allowing usage of @SystemApi classes. The Parcelable
implementation would be convenient for clients in any case.

Bug: 126477266
Test: atest FrameworksNetTests
Change-Id: Id2ef3cad261832a2918ccb6bb6bc154d99d75746
2019-03-15 13:41:59 +09:00
junyulai
9f87223db2 [KA02.5] Use binder thread and executor to invoke callback
Currently, client side of keepalive event handling rely on a
newly created thread, looper, messenger and handler per object.

However, by creating oneway AIDL interface with the executor,
the callbacks can be invoked on the binder thread with user
specified context, which not only greatly simplify the design
but also reduce the cost of current thread modeling.

Bug: 114151147
Bug: 123969871
Test: 1. atest FrameworksNetTests --generate-new-metric 10
      2. atest-deflake.sh

Change-Id: I27504074cd28d5b5eb94a7ec0e97ebaaaaa1ae3d
2019-03-14 19:24:12 +08:00
Ian Kasprzak
e04686ec67 Merge "Temporarily disable flaky test." am: d146d717c7 am: 3bab305ed9
am: 40088b623f

Change-Id: Ifcfee2d83c2a173f1cc2f22597aff3cffe558281
2019-03-12 22:40:38 -07:00
Xiao Ma
50caf2e4c4 Merge "[KA13]: add unit test for exposed TCP socket keepalive API." am: a0b41a33e0 am: c8131b1668
am: 3893672a94

Change-Id: Ib2b2474a74e2e84b3bb75c36b518ad48009065af
2019-03-12 22:19:28 -07:00
Chalard Jean
40f6974c7a Merge "Tell the factory it is already serving a request." 2019-03-13 02:07:29 +00:00
Ian Kasprzak
d146d717c7 Merge "Temporarily disable flaky test." 2019-03-13 01:52:21 +00:00
Xiao Ma
a0b41a33e0 Merge "[KA13]: add unit test for exposed TCP socket keepalive API." 2019-03-13 01:13:08 +00:00
Lorenzo Colitti
dc1e7d9bba Temporarily disable flaky test.
Test: None
Bug: 128426024
Change-Id: Id88bf452f41f512703d5831e357d9ba72dc5b911
2019-03-13 09:23:54 +09:00
Chalard Jean
44689aab3b Tell the factory it is already serving a request.
This is a cherry-pick of ag/607226 that has been rebased on
top of four years of changes and with comments addressed.

Gives each factory a serial number and propagates it to every
NetworkAgent so when a score comes back indicating a request is
being handled the factory can account for it properly.

Without this, a new request that's already handled by a network
offered by a factory will not cause an increment of the factorys
ref count. Concretely this results in issues like the RAT icon
not being displayed in spite of the network actually being up
and usable.

This will be ported to AOSP as soon as possible, but immediately
some master-only WiFi tests need to be adjusted with this change
which would not let me submit to AOSP.

Bug: 18637384
Bug: 29030667
Test: manual
Test: atest frameworks/opt/telephony/tests/telephonytests
Test: atest frameworks-net
Test: atest CtsNetTestCases CtsHostsideNetworkTests
Change-Id: I597ac588f76dd507512ff02868fd1310b7e63f7e
Merged-In: I597ac588f76dd507512ff02868fd1310b7e63f7e
2019-03-12 21:47:21 +09:00
Chalard Jean
6e6bca7632 Merge "[CS] Support "instant failure" from factories" 2019-03-12 12:04:46 +00:00
Lucas Lin
79309b59af Merge "Check if network has partial connectivity" am: e54e1235e6 am: 9ebfc37ff9
am: 8a7575af75

Change-Id: Ib6c5ecc8238e1ac237eddcc00802fa5e7c0e24b9
2019-03-12 01:47:25 -07:00
Xiao Ma
75bbf7157a [KA13]: add unit test for exposed TCP socket keepalive API.
Bug: 123987272
Test: atest FrameworksNetTests
Change-Id: I543d8f00ae539b706592a149981e3e8992999284
2019-03-12 17:30:47 +09:00
lucaslin
25a5047d2c Check if network has partial connectivity
In some networks, network validation may only get success
result for http probe but fail result for https probe.
For this kind of network, it may still work at some websites
or apps, but user didn't know about that. In order to fix this
issue, we will check if network has partial connectivity and
notify user to make a choice if they want to use this partial
connectivity or not.

Bug: 113450764
Test: 1. Build pass.
      2. Fake partial connectivity case for testing.
      3. atest FrameworksNetTests
      4. atest NetworkStackTests

Change-Id: I69ed00ac4850904ff708c9fef22e148879a10e92
2019-03-12 07:37:33 +00:00
Etan Cohen
06633de8ce [CS] Support "instant failure" from factories
Add a mechanism by which a factory can declare "instant failure" for
a request - which would result in it getting an OnUnavailable()
(even without a timeout).

Factories may only do this iff:
1. They know they are the only factory which may fulfill this
   request (common for transport-specific requests).
2. The know that the request can definitely not be
   fulfilled at any point in the future.

Bug: 31382922
Test: atest ConnectivityServiceTest
Merged-In: I9bce0f4d85fa8cad7f8a9998819f945b778c5ac5
Change-Id: I9bce0f4d85fa8cad7f8a9998819f945b778c5ac5
2019-03-11 16:15:43 -07:00
Brett Chabot
b0fcda5054 Merge "Migrate frameworks/base/tests/net/ to androidx.test" am: 216266b524 am: 36e7b25aea
am: 5633b0c200

Change-Id: I01657671712799f5a29a3a7530430cc5bfb14f41
2019-03-06 22:10:32 -08:00
Treehugger Robot
216266b524 Merge "Migrate frameworks/base/tests/net/ to androidx.test" 2019-03-07 05:42:07 +00:00
Brett Chabot
ab11bf1f20 Migrate frameworks/base/tests/net/ to androidx.test
Test: atest FrameworksNetTests
Change-Id: Iaa59d606f5e1678cc5aaca9ed37e184fad894e5d
2019-03-05 09:05:47 -08:00
Varun Anand
2484e523c7 Merge "Fix isActiveNetworkMetered for VPNs." am: 9fd6a19bb0 am: b6b97bb8c3
am: 8f8af9b629

Change-Id: I3d536324052227bbfab31ba5d608c35ecb9b1ab5
2019-03-04 18:09:07 -08:00
Varun Anand
9fd6a19bb0 Merge "Fix isActiveNetworkMetered for VPNs." 2019-03-05 01:37:30 +00:00
Varun Anand
65a199273f Merge "Remove ConnectivityManager and its usages from NetworkStatsService." 2019-03-01 01:14:34 +00:00
Varun Anand
5e980f4e3d Remove ConnectivityManager and its usages from NetworkStatsService.
NSS needed it for getting VpnInfo[], NetworkState[] and
activeLinkProperties which it used to query via ConnectivityManager.

For VpnInfo[], this was racy as NSS may ignore intermediate changes to a
VPN's underlying networks. See http://b/123961098 for more context.

It may also lead to deadlocks b/w ConnectivityService and
NetworkStatsService. See http://b/126245192 for more info.

This change will ensure that NSS is never contending on any of
ConnectivityService locks.

Bug: 123961098
Bug: 126245192
Bug: 120145746
Test: atest FrameworksNetTests
Change-Id: Id1da446b54d95ee68ed14079107b1a10318bcf8b
Merged-In: I57e117bb4e9efe491b19d6b5a479f2d58d1c58e6
2019-03-01 00:10:52 +00:00
Varun Anand
65d59a826f Remove ConnectivityManager and its usages from NetworkStatsService.
NSS needed it for getting VpnInfo[], NetworkState[] and
activeLinkProperties which it used to query via ConnectivityManager.

For VpnInfo[], this was racy as NSS may ignore intermediate changes to a
VPN's underlying networks. See http://b/123961098 for more context.

It may also lead to deadlocks b/w ConnectivityService and
NetworkStatsService. See http://b/126245192 for more info.

This change will ensure that NSS is never contending on any of
ConnectivityService locks.

Bug: 123961098
Bug: 126245192
Bug: 120145746
Test: atest FrameworksNetTests
Change-Id: I57e117bb4e9efe491b19d6b5a479f2d58d1c58e6
2019-02-28 13:43:02 -08:00
Varun Anand
e93a4f3775 Fix isActiveNetworkMetered for VPNs.
This change is basically a revert of http://ag/3580901.
It was made because previously VPN capabilities did not use to update
based on its underlying networks. That is no longer the case anymore.

This was previously returning meteredness on the basis of VPN's first
underlying network which is incorrect in cases such as VPN using
multiple underlying networks, or VPN that has explicitly marked itself
as metered via VpnService.Builder#setMetered API.

Bug: 123936838
Test: atest FrameworksNetTests
Change-Id: Ia54b8570fbad4a638a6d43a95e0271c6baf66685
2019-02-28 13:18:11 -08:00
Lorenzo Colitti
aea49ff19a Merge changes from topic "nat64" am: cfb7f03ec9 am: e98fe61189
am: 6c43228859

Change-Id: Iffd1a988d631c9285bad232cc60ae321abc866e8
2019-02-27 16:37:43 -08:00