Commit graph

12,453 commits

Message SHA1
Merge "Revert "Add an API to listen for changes in network blocked status of an uid.""
Anthony Stange   authored and   Gerrit Code Review   commited 2021-03-18 16:52:08 +00:00
2bb1da3473
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

Anthony Stange   commited 2021-03-18 16:51:22 +00:00
d88174dafd
Merge changes from topic "revert-1626206-replaceUidRange-MSYTKFNGUE"
* changes:
  Revert "Replace the usage of UidRange"
  Revert "Expose uids related APIs in NetworkRequest and NetworkCa..."

Anthony Stange   authored and   Gerrit Code Review   commited 2021-03-18 16:40:53 +00:00
2576238aec
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

Anthony Stange   commited 2021-03-18 16:30:59 +00:00
f0b9889ccf
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

Anthony Stange   commited 2021-03-18 16:30:59 +00:00
84d92b3ce1
Merge "Add an API to listen for changes in network blocked status of an uid."
Sudheer Shanka   authored and   Gerrit Code Review   commited 2021-03-18 15:29:17 +00:00
c262455617
Merge "Expose systemReady for SystemServer"
Lucas Lin   authored and   Gerrit Code Review   commited 2021-03-18 13:40:54 +00:00
33737f6ac4
Merge changes from topic "replaceUidRange"
* changes:
  Expose uids related APIs in NetworkRequest and NetworkCapabilities
  Replace the usage of UidRange

Chiachang Wang   authored and   Gerrit Code Review   commited 2021-03-18 13:36:39 +00:00
7b582e9749
Merge "Expose APIs for Settings"
Chiachang Wang   authored and   Gerrit Code Review   commited 2021-03-18 13:27:47 +00:00
53178361ae
Merge "Add a VpnManager.TYPE_VPN_OEM."
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2021-03-18 13:12:08 +00:00
96d66bb7b8
Merge "Address remaining comments on aosp/1607893"
Chalard Jean   authored and   Gerrit Code Review   commited 2021-03-18 12:30:14 +00:00
08b0411d4f
Address remaining comments on aosp/1607893
Test: ConnectivityServiceTest
Change-Id: Icf70b20624604bfade37804311a77ef6be564c09

Chalard Jean   commited 2021-03-18 12:30:00 +00:00
4de6088dc9
Merge "Move constants to MODULE_LIB"
Chalard Jean   authored and   Gerrit Code Review   commited 2021-03-18 12:29:38 +00:00
229cf59510
Merge "Add more connectivity module settings"
Paul Hu   authored and   Gerrit Code Review   commited 2021-03-18 12:22:55 +00:00
9abe34a466
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

Sudheer Shanka   authored and   Remi NGUYEN VAN   commited 2021-03-18 10:42:25 +00:00
cc8f26dea8
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

Lorenzo Colitti   commited 2021-03-18 05:54:53 +00:00
3541fcbcbc
Add more connectivity module settings
Add more connectivity module settings and update all references
to ConnectivitySettingsManager.

Bug: 182538166
Test: atest FrameworksNetTests
Change-Id: Ie96fbd0996ed3acb37099b6270bf3d4c2e558e9a

paulhu   commited 2021-03-18 11:58:29 +08:00
79260c21a8
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

Chiachang Wang   commited 2021-03-18 11:18:56 +08:00
0cefc1c20a
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

Remi NGUYEN VAN   commited 2021-03-18 00:29:08 +09:00
1142754c99
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

Chiachang Wang   commited 2021-03-17 23:13:39 +08:00
f379ceec8e
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

Chiachang Wang   commited 2021-03-17 23:02:22 +08:00
bb2439a884
Merge "Add ConnectivitySettingsManager"
Paul Hu   authored and   Gerrit Code Review   commited 2021-03-17 14:57:32 +00:00
3e17e82ab1
Merge "Remove Protocol.BASE_* usage in Connectivity"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-03-17 14:53:26 +00:00
7ffb87e4ce
Merge "Remove Settings.Global.TCP_DEFAULT_INIT_RWND on CS"
Paul Hu   authored and   Gerrit Code Review   commited 2021-03-17 14:44:17 +00:00
3d136c56ca
Merge "Remove extra comment"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-03-17 12:16:09 +00:00
be83a4afc5
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

Remi NGUYEN VAN   commited 2021-03-17 20:56:50 +09:00
a711b3f96c
Merge "Modify the comment of getPrivateDnsMode"
Lucas Lin   authored and   Gerrit Code Review   commited 2021-03-17 11:25:18 +00:00
de9a3af4de
Merge "Remove usage of networkAttributes"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-03-17 11:24:28 +00:00
5ccc21eb9b
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

paulhu   authored and   Paul Hu   commited 2021-03-17 11:14:35 +00:00
0620c858ae
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

Remi NGUYEN VAN   commited 2021-03-17 10:58:08 +00:00
eade234e2a
Add ConnectivitySettingsManager
This class is used to manager the connectivity module related
settings.

Bug: 182538166
Test: make
Change-Id: I5e02e719ce0d305d7c8a45fefb850d7b981f07eb

paulhu   commited 2021-03-17 18:24:16 +08:00
1510c9c29f
Modify the comment of getPrivateDnsMode
Bug: 172183305
Test: m
Change-Id: I2f1b44cf2a362b42f052ea5d34a5cec03d46e661

lucaslin   commited 2021-03-17 14:53:35 +08:00
73c9860a06
Merge "Change the parameter type from ContentResolver to Context"
Lucas Lin   authored and   Gerrit Code Review   commited 2021-03-17 06:35:21 +00:00
8d638d9434
Expose systemReady for SystemServer
SystemServer cannot call the hidden API of ConnectivityManager
after it becomes a part of mainline module. So expose the hidden
API for SystemServer.

Bug: 182963354
Test: m services
Change-Id: I9c1dc8eb1401dbdc069d5c9fc3992f4c7939b70e

lucaslin   commited 2021-03-17 14:16:55 +08:00
8c121bfde3
Move constants to MODULE_LIB
These constants are used by a MODULE_LIBRARIES API, they should
have the same visibility.

Test: ConnectivityServiceTest
Change-Id: I14cb189d949fe552f463cae3002801fd8cf8230c

Chalard Jean   commited 2021-03-17 14:59:24 +09:00
560d4032c4
Merge changes I335e82e2,I84ba363d,I8f18083b,I854a952d,I00e23441
* changes:
  Remove per-user preference when the user is removed
  Expose the enterprise per-profile networking API.
  Implement setNetworkPreferenceForUser.
  Public API for per-profile network preference.
  Add tests for setNetworkPreferenceForUser

Chalard Jean   authored and   Gerrit Code Review   commited 2021-03-17 05:48:18 +00:00
bf97a3ab5e
Merge "Remove MessageUtils usage in VpnTransportInfo"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-03-17 00:14:10 +00:00
0b33d35188
Merge "Move LocationPermissionChecker to libs/net"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-03-17 00:13:21 +00:00
6dde6eceab
[VCN14] Expose registerBestMatchingNetworkCallback
Test: m -j doc-comment-check-docs
Bug: 175662146
Change-Id: Ie67dd2f4f8d973de37bc64a03908d7cbb7c2b7ad

junyulai   commited 2021-03-16 21:30:56 +08:00
bd62226850
[VCN13] Implement tracking best matching network
This is done by:
  1. In requestNetwork, provide a basic permission check.
  2. rematchNetworksAndRequests: no change, since non listen
     requests will be automatically processed to track
     best satisfying network.
  3. applyNetworkReassignment: no change, since non-request
     will not be sent to factories.

Test: atest ConnectivityServiceTest#testRegisterBestMatchingNetworkCallback_noIssueToFactory
Test: atest ConnectivityServiceTest#testRegisterBestMatchingNetworkCallback_trackBestNetwork
Bug: 175662146
Change-Id: I8cf4ab334df6812d84cdda160e9b72b6f54062af

junyulai   commited 2021-03-16 21:30:55 +08:00
8cae3c748f
Merge "Replace interal okhttp APIs"
Paul Hu   authored and   Gerrit Code Review   commited 2021-03-16 12:18:49 +00:00
e3ed08a24d
Remove per-user preference when the user is removed
Test: new test for this
Change-Id: I335e82e29ec8f4c8da9def8b40153858cfd5bacb

Chalard Jean   commited 2021-03-16 12:14:12 +00:00
6bb468c476
Expose the enterprise per-profile networking API.
Also unify the listener for Oem settings, which have
never been released as public API (it is slated to be
released in S).

Test: FrameworksNetTests
Change-Id: I84ba363dd0ec03871c37b1c3a31e5557d9aa12e7

Chalard Jean   commited 2021-03-16 12:14:00 +00:00
cc9ad15cd2
Implement setNetworkPreferenceForUser.
Test: FrameworksNetTests
Change-Id: I8f18083b5857289892fe8adea5f5ea3f5dbe0809

Chalard Jean   commited 2021-03-16 12:13:46 +00:00
9d96818bf2
Public API for per-profile network preference.
This patch defines the API, but does not make it public
yet as there is no implementation yet.

Test: none so far
Change-Id: I854a952dfe35cc80847eb62f522b1667b8e9b8a0

Chalard Jean   commited 2021-03-16 12:13:27 +00:00
03433057cb
Add tests for setNetworkPreferenceForUser
Test: this
Change-Id: I00e2344118408da307439a0a993eb67cb17bf777

Chalard Jean   commited 2021-03-16 12:11:27 +00:00
38a4e7fb76
Merge "Remove NETWORK_STACK_UID check"
Lucas Lin   authored and   Gerrit Code Review   commited 2021-03-16 11:26:24 +00:00
5f7eb9024e
Change the parameter type from ContentResolver to Context
Context is more useful than ContentResolver, it can provide more
information if we want to change the behavior in the future.

Bug: 172183305
Test: atest FrameworksNetTests
Change-Id: I5702c7d74b862a76558b94f1abe2c6df9eb7f097
Merged-In: I5702c7d74b862a76558b94f1abe2c6df9eb7f097

lucaslin   authored and   Lucas Lin   commited 2021-03-16 09:26:57 +00:00
1162662032
Remove NETWORK_STACK_UID check
NETWORK_STACK_UID check was introduced by aosp/1134635, and it
assumed that wifi factories/agents will be running on the network
stack process, but it didn't eventually. It runs in the system
server instead. So remove this check.

Bug: 170598012
Test: atest FrameworksNetTests
Change-Id: Ie11268738e364e252f18876f7a4a0dc064ca8b9c

lucaslin   authored and   Lucas Lin   commited 2021-03-16 09:16:38 +00:00
2d72a13e60
Merge "Add comments to describe the value of converting hex to decimal"
Lucas Lin   authored and   Gerrit Code Review   commited 2021-03-16 08:31:10 +00:00
26f778d2bd