Commit Graph

12473 Commits

Author SHA1 Message Date
Chalard Jean
dc2fed3454 Merge "[NS03] Mix in other CS-managed properties" 2021-03-19 10:32:46 +00:00
Lucas Lin
0f441f7bdd Merge "Expose getCapabilities" 2021-03-19 10:24:25 +00:00
Treehugger Robot
cd3ea1f002 Merge "Reland "Add an API to listen for changes in network blocked status of an uid."" 2021-03-19 10:12:15 +00:00
Chiachang Wang
94dc99ea38 Merge "Send a Network instead of network id for wifi no internet dialog" 2021-03-19 07:54:24 +00:00
Aaron Huang
ed15b01b0d Merge "Remove hidden API usage from ProxyTracker" 2021-03-19 07:50:27 +00:00
Lorenzo Colitti
a6b1b9d110 Merge "Ensure all calls to getCallingUid use the version in mDeps." 2021-03-19 07:36:52 +00:00
Aaron Huang
d1a8c71ed9 Remove hidden API usage from ProxyTracker
Connectivity mainline module cannot use HandlerExecutor because it
is a hidden API. So, replace it with alternative.

Bug: 177035719
Test: FrameworksNetTests
Change-Id: I228a8a2e3479b0af1e977d13f877a565f0789a7e
2021-03-19 06:03:08 +00:00
Chalard Jean
a5323dd580 Merge "[NS02] Mix in validation of the score" 2021-03-19 05:39:40 +00:00
Chalard Jean
67b66080a0 [NS03] Mix in other CS-managed properties
These properties are necessary to figure out the maximum
score of a network.

Test: FrameworksNetTests
Change-Id: I48dce20ad4a80597039393dca607e8da829b2a61
2021-03-19 13:50:56 +09:00
Chalard Jean
6bde0e5c04 [NS02] Mix in validation of the score
Test: FrameworksNetTests FrameworksWifiTests NetworkStackTests
Change-Id: I9cac3a05ad0c4008599973b12d2c5e4c02233a5c
2021-03-19 13:50:56 +09:00
Treehugger Robot
f678876c62 Merge "CaptivePortalData: use CharSequence in VenueFriendlyName API" 2021-03-19 04:13:36 +00:00
Chiachang Wang
ef52aade37 Send a Network instead of network id for wifi no internet dialog
It's a refactor work for incoming connectivity mainline. The
network information contained in the no internet notification
action was placed the target network id. The receiver which is
Settings will need to construct the network from the network id
using the hidden Network constructor. Since Network is moving
into module, Settings will not be able to access it. Apps should
use Network instead of network id, so just send the network
object to Settings.

Bug: 172183305
Test: manually test with no internet dialog and check the
      behavior and log
Test: atest FrameworksNetTests
Change-Id: I68acc70a26a27eeeb9ab7af068a459905839f942
2021-03-19 02:08:01 +00:00
Remi NGUYEN VAN
e1da163302 Merge "Add InetAddressCompat" 2021-03-18 23:58:16 +00:00
Remi NGUYEN VAN
f0f68f5561 Merge "Move network selection utils to Connectivity" 2021-03-18 23:57:34 +00:00
Sudheer Shanka
e95b266e54 Reland "Add an API to listen for changes in network blocked status of an uid."
This reverts commit d88174dafd.

Reason for revert: The issue causing the build breakage has been fixed

Change-Id: I03fa406551b51aaa4d4d9255cf1a53f9b4bcc1bd
Merged-In: Ib9949b8619c6b148f73630b314c4113d76c31ec1
2021-03-18 19:11:55 +00:00
Anthony Stange
2bb1da3473 Merge "Revert "Add an API to listen for changes in network blocked status of an uid."" 2021-03-18 16:52:08 +00:00
Anthony Stange
d88174dafd Revert "Add an API to listen for changes in network blocked status of an uid."
This reverts commit cc8f26dea8.

Reason for revert: Breaking build - b/183106805
Bug: 183106805
Merged-In: Ib9949b8619c6b148f73630b314c4113d76c31ec1
Change-Id: I9789ed81e630f49c71034b6917188983bd11d774
2021-03-18 16:51:22 +00:00
Anthony Stange
2576238aec Merge changes from topic "revert-1626206-replaceUidRange-MSYTKFNGUE"
* changes:
  Revert "Replace the usage of UidRange"
  Revert "Expose uids related APIs in NetworkRequest and NetworkCa..."
2021-03-18 16:40:53 +00:00
Anthony Stange
f0b9889ccf Revert "Replace the usage of UidRange"
Revert "Add shims for NetworkRequest"

Revert submission 1626206-replaceUidRange

Reason for revert: Breaking build - b/183106405
Reverted Changes:
I0b79c73e8:Add shims for NetworkRequest
I4bc0daf5a:Replace the usage of UidRange
I4e5aec6ef:Replace the usage of UidRange
I107c329d4:Expose uids related APIs in NetworkRequest and Net...

Change-Id: I6290429db1c8e787f8138b55b98fd92a74ac6402
2021-03-18 16:30:59 +00:00
Anthony Stange
84d92b3ce1 Revert "Expose uids related APIs in NetworkRequest and NetworkCa..."
Revert "Add shims for NetworkRequest"

Revert submission 1626206-replaceUidRange

Reason for revert: Breaking build - b/183106405
Reverted Changes:
I0b79c73e8:Add shims for NetworkRequest
I4bc0daf5a:Replace the usage of UidRange
I4e5aec6ef:Replace the usage of UidRange
I107c329d4:Expose uids related APIs in NetworkRequest and Net...

Change-Id: I45e08f89533af0d6851add38fecb5c6c114615ae
2021-03-18 16:30:59 +00:00
Sudheer Shanka
c262455617 Merge "Add an API to listen for changes in network blocked status of an uid." 2021-03-18 15:29:17 +00:00
Remi NGUYEN VAN
65b24f7034 Move network selection utils to Connectivity
NetworkScore, IOnCompleteListener should be in the Connectivity scope,
as they are supporting classes for the ConnectivityManager APIs.

Bug: 181512874
Test: m
Change-Id: I6dc40a80e0bf5f86f5625b657b01eba969d41fcf
2021-03-18 23:57:26 +09:00
Remi NGUYEN VAN
33e3abb3b5 Add InetAddressCompat
Although the InetAddress symbols used by Connectivity are stable core
platform API, and should be usable, the core_current stubs are not yet
part of the module_current API.
Until that is fixed, add an InetAddressCompat utility that calls the
three static methods by reflection.

Test: atest FrameworksNetTests CtsNetTestCases
Bug: 183097033
Change-Id: I797009aeff1d39ae2dc06ef69d2e235689b43c89
2021-03-18 23:54:04 +09:00
Lucas Lin
33737f6ac4 Merge "Expose systemReady for SystemServer" 2021-03-18 13:40:54 +00:00
Chiachang Wang
7b582e9749 Merge changes from topic "replaceUidRange"
* changes:
  Expose uids related APIs in NetworkRequest and NetworkCapabilities
  Replace the usage of UidRange
2021-03-18 13:36:39 +00:00
Chiachang Wang
53178361ae Merge "Expose APIs for Settings" 2021-03-18 13:27:47 +00:00
Lorenzo Colitti
96d66bb7b8 Merge "Add a VpnManager.TYPE_VPN_OEM." 2021-03-18 13:12:08 +00:00
lucaslin
e01f6d4df4 Expose getCapabilities
Expose getCapabilities() for EthernetNetworkFactory.

Bug: 182963415
Test: m ethernet-service
Change-Id: I430416af8fae3d4ee99f2f2abe529e3051e9e5cb
2021-03-18 20:30:22 +08:00
Chalard Jean
08b0411d4f Merge "Address remaining comments on aosp/1607893" 2021-03-18 12:30:14 +00:00
Chalard Jean
4de6088dc9 Address remaining comments on aosp/1607893
Test: ConnectivityServiceTest
Change-Id: Icf70b20624604bfade37804311a77ef6be564c09
2021-03-18 12:30:00 +00:00
Chalard Jean
229cf59510 Merge "Move constants to MODULE_LIB" 2021-03-18 12:29:38 +00:00
Paul Hu
9abe34a466 Merge "Add more connectivity module settings" 2021-03-18 12:22:55 +00:00
Sudheer Shanka
cc8f26dea8 Add an API to listen for changes in network blocked status of an uid.
Given that ConnectivityService is moving to a mainline module, we need
a @SystemApi for it to listen for changes in blocked status of an uid.
So, we decided to create a new API for this which can provide
ConnectivityService with more info about why an uid is blocked (which
will be useful for adding a new similar onBlockedStatusChanged callback
in CM.NetworkCallback) and also captures data saver restriction without
having out to track it separately.

Currently, NPMS does some redundant computations because we are
calculating both uid rules and blocked reasons separately. In a
follow-up change, we will compute uid rules using blocked reasons
and later possibly remove that onUidRulesChanged callback.

Bug: 176289731
Test: atest ./tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Test: atest ./tests/net/java/com/android/server/ConnectivityServiceTest.java
Test: atest ./services/tests/servicestests/src/com/android/server/net/NetworkPolicyManagerServiceTest.java
Change-Id: Ib9949b8619c6b148f73630b314c4113d76c31ec1
Merged-In: Ib9949b8619c6b148f73630b314c4113d76c31ec1
2021-03-18 10:42:25 +00:00
Lorenzo Colitti
3541fcbcbc Add a VpnManager.TYPE_VPN_OEM.
This needed for OEMs that have VPN types not supported by AOSP.

Bug: 171872481
Test: new test coverage in VpnTransportInfoTest
Change-Id: Ic7529bef7f12d2c74a3be5b1a4a2d54fb0d0bfac
2021-03-18 05:54:53 +00:00
paulhu
79260c21a8 Add more connectivity module settings
Add more connectivity module settings and update all references
to ConnectivitySettingsManager.

Bug: 182538166
Test: atest FrameworksNetTests
Change-Id: Ie96fbd0996ed3acb37099b6270bf3d4c2e558e9a
2021-03-18 11:58:29 +08:00
Chiachang Wang
0cefc1c20a Expose APIs for Settings
ConnectivityManager will be a part of incoming connectivity
mainline. Settings will no longer to access the hidden methods.
For those methods that accept the interaction from users, they
should be exposed as formal interface to allow the
functionality. Expose them to API surface.

Bug: 172183305
Test: make update-api
Change-Id: Id4533b94291766bb060af0091b5ccb81a00630fd
2021-03-18 11:18:56 +08:00
Remi NGUYEN VAN
1142754c99 Add framework-connectivity.impl
The library will be included in the connectivity module APEX when
migrating its sources out of framework-minus-apex.

Bug: 171540887
Test: m
Change-Id: I1595521eaced6e6997c076bb56b06ffdd22a4fa0
2021-03-18 00:29:08 +09:00
Chiachang Wang
f379ceec8e Expose uids related APIs in NetworkRequest and NetworkCapabilities
NetworkRequest is moving into the incoming connectivity mainline
module. The hidden setUids becomes inaccessible outside the
module. Shims for support cts in different API levels will need
to use it to verify the behavior of NetworkRequest. Thus, expose
it to the API surface.

Also, VPN uses getUids and setUids to control network
capabilities. Networkcapabilities is a part of incoming
connectivity mainline module but VPN is not. Thus, exposing these
two methods are needed to allow VPN to continue using it.

Test: make update-api
Bug: 172183305
Change-Id: I107c329d4d7130d488772166eae8b5e7aaa2ff04
2021-03-17 23:13:39 +08:00
Chiachang Wang
bb2439a884 Replace the usage of UidRange
UidRange is used in a shared way between ConnectivityService
and VPN through the use of NetworkCapabilities. UidRange will
be part of the ConnectivityService mainline but Vpn.java will
stay in the framework. We need a way to replace the APIs using
UidRange, or to make UidRange system API. The only really
relevant surface here is NetworkCapabilities#{setUids, getUids}.
The need for UidRange could be replaced by an integer Range, so
replace the usage of UidRange by a integer Range in
NetworkCapabilities#{setUids, getUids} and update the relevant
callers.

Bug: 172183305
Test: atest FrameworksNetTests CtsNetTestCasesLatestSdk
Change-Id: I4e5aec6ef1ea02e038fcd7ed117a3b67b69c5cb9
2021-03-17 23:02:22 +08:00
Paul Hu
3e17e82ab1 Merge "Add ConnectivitySettingsManager" 2021-03-17 14:57:32 +00:00
Remi NGUYEN VAN
7ffb87e4ce Merge "Remove Protocol.BASE_* usage in Connectivity" 2021-03-17 14:53:26 +00:00
Paul Hu
3d136c56ca Merge "Remove Settings.Global.TCP_DEFAULT_INIT_RWND on CS" 2021-03-17 14:44:17 +00:00
Remi NGUYEN VAN
be83a4afc5 Merge "Remove extra comment" 2021-03-17 12:16:09 +00:00
Remi NGUYEN VAN
a711b3f96c Remove Protocol.BASE_* usage in Connectivity
ConnectivityManager and NetworkAgent do not share their handler with any
other component, so there is no reason to use addresses that do not
overlap. Protocol.BASE_* was written to allow for interaction "between
different StateMachine implementations without a conflict", but the
classes do not use StateMachine, and they do not have such interactions.

Bug: 177046265
Test: atest FrameworksNetTests
Change-Id: I18c341d4a2c01cb9559d682a9ad1ff259e6b5855
2021-03-17 20:56:50 +09:00
Lucas Lin
de9a3af4de Merge "Modify the comment of getPrivateDnsMode" 2021-03-17 11:25:18 +00:00
Remi NGUYEN VAN
5ccc21eb9b Merge "Remove usage of networkAttributes" 2021-03-17 11:24:28 +00:00
paulhu
0620c858ae Remove Settings.Global.TCP_DEFAULT_INIT_RWND on CS
TCP_DEFAULT_INIT_RWND setting has never been set before, CS
always read the tcp receive window size from
net.tcp.default_init_rwnd then set to net.tcp_def_init_rwnd.
Thus, remove the unnecessary setting from CS, and the property
doesn't need to set either. Because aosp/1639922 migrate the
properties, the default value has been set to kernel already.

Bug: 182538166
Test: atest FrameworksNetTests
Change-Id: I13e175ab4dea72446af7df4a25e307e5934fa813
2021-03-17 11:14:35 +00:00
Remi NGUYEN VAN
eade234e2a Remove extra comment
This fixes a merge conflict with downstream branches due to an
incomplete cherry-pick.

Bug: 171540887
Test: m

Change-Id: I27a8f20f1a1d83b472700648f3f5a68413a76ac3
Merged-In: I7432fe4c87cd3cab04dcb6185c9a4f3f84376549
2021-03-17 10:58:08 +00:00
paulhu
1510c9c29f Add ConnectivitySettingsManager
This class is used to manager the connectivity module related
settings.

Bug: 182538166
Test: make
Change-Id: I5e02e719ce0d305d7c8a45fefb850d7b981f07eb
2021-03-17 18:24:16 +08:00
lucaslin
73c9860a06 Modify the comment of getPrivateDnsMode
Bug: 172183305
Test: m
Change-Id: I2f1b44cf2a362b42f052ea5d34a5cec03d46e661
2021-03-17 14:53:35 +08:00