Commit Graph

12550 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
b1155aa195 Merge "Move network selection utils to Connectivity" am: f0f68f5561
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1645291

Change-Id: I452591707a97b501f189fa9f61e90da842fa3734
2021-03-19 00:35:03 +00:00
Remi NGUYEN VAN
f0f68f5561 Merge "Move network selection utils to Connectivity" 2021-03-18 23:57:34 +00:00
Anthony Stange
00a2a4c7ce [automerger skipped] Merge "Revert "Add an API to listen for changes in network blocked status of an uid."" am: 2bb1da3473 -s ours
am skip reason: skip tag Change-Id Ib9949b8619c6b148f73630b314c4113d76c31ec1 with SHA-1 cc8f26dea8 is already in history

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1645826

Change-Id: Ib47f1d63ab15abf1ad8aba79f6f2922abf959010
2021-03-18 17:11:21 +00:00
Anthony Stange
37cb1551a0 Merge changes from topic "revert-1626206-replaceUidRange-MSYTKFNGUE" am: 2576238aec
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1645768

Change-Id: I311d4e3e5718afbe7d9817a4c85040d8afe5d66d
2021-03-18 17:02:59 +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
5580953ba4 Merge "Add an API to listen for changes in network blocked status of an uid." am: c262455617
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1612823

Change-Id: Iff60405d8f925d0a95ea4bf3230da38ce822c9f2
2021-03-18 16:09:58 +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
Lucas Lin
7d2c52067f Merge "Expose systemReady for SystemServer" am: 33737f6ac4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1640142

Change-Id: I4680cd76d6e5c074e291bddcf1bd4bd3871365a1
2021-03-18 14:05:03 +00:00
Chiachang Wang
38794c5290 Merge changes from topic "replaceUidRange" am: 7b582e9749
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1626206

Change-Id: I3d62d9c03ab6a418e23dd6c5e6f8317b7b375f9c
2021-03-18 14:01:33 +00:00
Chiachang Wang
94e9fb339f Merge "Expose APIs for Settings" am: 53178361ae
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1644202

Change-Id: Ia47e8efc3cc3f40b396c0aa0bd49afea2385e9c3
2021-03-18 13:53:36 +00:00
Lorenzo Colitti
6ace66ed21 Merge "Add a VpnManager.TYPE_VPN_OEM." am: 96d66bb7b8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1644265

Change-Id: Ie010e23484d9ec7ad31631d72292cc52c96f2c10
2021-03-18 13:50:18 +00: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
Chalard Jean
ec138734a7 Merge "Address remaining comments on aosp/1607893" am: 08b0411d4f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1640140

Change-Id: I49b1ea7e3461ef0cad563d5d7933b5535f94d08c
2021-03-18 12:59:06 +00:00
Chalard Jean
39356af73f Merge "Move constants to MODULE_LIB" am: 229cf59510
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1640141

Change-Id: Ib22b9f3223af2cfe51438e2e19584ec089a4e9d2
2021-03-18 12:55:57 +00:00
Paul Hu
88d4fc79df Merge "Add more connectivity module settings" am: 9abe34a466
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1641784

Change-Id: If6fab011720145f2ba18df478e6660be442bcad5
2021-03-18 12:53:52 +00: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
Remi NGUYEN VAN
b78337d701 Remove extra comment
This fixes a merge conflict with downstream branches due to an
incomplete cherry-pick.

Bug: 171540887
Test: m

Merged-In: I0c0daa91ef272a19c548cf55eb2f764c95f8f844
Change-Id: I0ec602f573698578e4d72d38772c39a1b88b87d2
2021-03-18 07:11:48 +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
Remi NGUYEN VAN
74a87c1b2a Merge "Add framework-connectivity.impl" am: 0fcb8d6db4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1635039

Change-Id: I9956c78228c2d04e20edf6fee1061861e26978b9
2021-03-18 03:33:42 +00: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
Paul Hu
af229a6c7b Merge "Add ConnectivitySettingsManager" am: 3e17e82ab1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1641759

Change-Id: I84e3e2eb6f507abf6220b43886f6ab9e1fad4218
2021-03-17 15:27:02 +00:00
Remi NGUYEN VAN
e4a8d2ff33 Merge "Remove Protocol.BASE_* usage in Connectivity" am: 7ffb87e4ce
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1629266

Change-Id: Ieca69d4ff1d2a7f3b369bb4dcabaa702fbab4594
2021-03-17 15:19:31 +00:00
Paul Hu
f3ba1620ea Merge "Remove Settings.Global.TCP_DEFAULT_INIT_RWND on CS" am: 3d136c56ca
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1635043

Change-Id: Ia8fa547044f9674b1c465606e43c346ba0bc7c0e
2021-03-17 15:14:21 +00: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
3414a57e61 [automerger skipped] Merge "Remove extra comment" am: be83a4afc5 -s ours
am skip reason: skip tag Change-Id I7432fe4c87cd3cab04dcb6185c9a4f3f84376549 with SHA-1 d2107994d6 is already in history

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1641959

Change-Id: Ifd4bbb99c60e9d538fc87d5015dc2b0f7af4d125
2021-03-17 12:54:22 +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
e0e9636048 Merge "Modify the comment of getPrivateDnsMode" am: de9a3af4de
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1640143

Change-Id: I46131b18e8e09d1c2b7a0b3fe5913511942b7096
2021-03-17 11:54:29 +00:00
Remi NGUYEN VAN
5498465192 Merge "Remove usage of networkAttributes" am: 5ccc21eb9b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1623260

Change-Id: I52a3125843e093c5a7d0d80c2a5c9608b397ea00
2021-03-17 11:51:17 +00: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