Commit Graph

309 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
8f0031d7aa Move NetworkUtils JNI out of core/jni
Keep the utilities included via a library, but move them out of
core/jni, and prepare a library to package them together with
framework-connectivity.

Also remove unnecessary dependencies in framework-connectivity.

Bug: 171540887
Test: device boots and has connectivity

Change-Id: I0b55dfe92f3cb6e848d79ac7953756f39aaa2597
2021-03-19 11:01:17 +00:00
Remi NGUYEN VAN
abba870866 Merge "Move connectivity AIDLs to android.net" into sc-dev 2021-03-19 10:51:22 +00:00
Chiachang Wang
d8802f6968 Merge "Expose constants of ConnectivityManager" into sc-dev 2021-03-19 10:40:49 +00:00
Chiachang Wang
293900ff01 Merge changes from topic "replaceUidRange" into sc-dev
* changes:
  Expose uids related APIs in NetworkRequest and NetworkCapabilities
  Replace the usage of UidRange
2021-03-19 10:32:30 +00:00
Remi NGUYEN VAN
af56509da2 Merge "Revert "CaptivePortalData: use CharSequence in VenueFriendlyName API"" into sc-dev 2021-03-19 09:38:35 +00:00
Remi NGUYEN VAN
f5bcd32331 Revert "CaptivePortalData: use CharSequence in VenueFriendlyName API"
This reverts commit 89aaa0c517.

Reason for revert: b/183174863
Bug: 183174863

Change-Id: I4db923e112bba149f4e8eb4cfa8c3f97defd5e63
2021-03-19 08:10:35 +00:00
Remi NGUYEN VAN
8ffe4eb5e3 Move connectivity AIDLs to android.net
java_sdk_libraries and apexes need to contain bootclasspath classes
under predefined packages. Tethering currently uses android.net, so make
sure all the connectivity bootclasspath classes are under android.net.

This avoids maintaining two packages for the tethering APEX, where
com.android.connectivity.aidl is only used by internal AIDL files.

Bug: 182984842
Test: m
Change-Id: I611f1941698c574e37aea912ee76dadc8b32e41a
2021-03-19 07:44:21 +00:00
Chalard Jean
2a98777408 Merge "[NS02] Mix in validation of the score" am: a5323dd580 am: 211f271ce4 am: ff706470e9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1556100

Change-Id: I4a622efe89f7d116751d0243ba29441ef76e997a
2021-03-19 07:27:43 +00:00
Remi NGUYEN VAN
2a311db05b Build framework-connectivity using module_current
framework-connectivity needs to build only against stable APIs.

Bug: 171540887
Test: m framework-connectivity.impl
Change-Id: I2d51d37d067bf6fe86e4dedf05855a2dd67ed57c
2021-03-19 06:02:43 +00:00
Treehugger Robot
89aaa0c517 Merge "CaptivePortalData: use CharSequence in VenueFriendlyName API" am: f678876c62 am: cbb8786faf am: 9f4d989074
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1640985

Change-Id: I933407d55e33a2cfac44ded44bc58fc0deb9da80
2021-03-19 05:32:21 +00: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
Remi NGUYEN VAN
c54ceba085 Merge "Remove Preconditions usage in TestNetworkSpecifier" into sc-dev 2021-03-19 04:49:52 +00:00
Remi NGUYEN VAN
a59373b155 Merge "Revert "Revert "Remove connectivity dependency on Preconditions""" into sc-dev 2021-03-19 04:49:06 +00:00
Treehugger Robot
f678876c62 Merge "CaptivePortalData: use CharSequence in VenueFriendlyName API" 2021-03-19 04:13:36 +00:00
Remi NGUYEN VAN
75764ba611 Merge "Add InetAddressCompat" am: e1da163302 am: 2aec625379 am: 9bdd98e71d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1645289

Change-Id: I90dba64e96080cbd29f538de6dcb514dea4b6cbd
2021-03-19 02:52:58 +00:00
Remi NGUYEN VAN
2270e98802 Merge "Move network selection utils to Connectivity" am: f0f68f5561 am: b1155aa195 am: b4525057e5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1645291

Change-Id: I0b984a01e1688b8484f3500945d0e429e1b3ca00
2021-03-19 02:52:41 +00:00
lucaslin
1a0ca5f171 Expose constants of ConnectivityManager
The callers cannot call the hidden APIs after ConnectivityManager
became a part of mainline module, so expose them for callers.
Also change the value of ACTION_PROMPT_PARTIAL_CONNECTIVITY,
ACTION_PROMPT_LOST_VALIDATION and ACTION_PROMPT_UNVALIDATED because
of API lint errors.

Bug: 172183305
Test: Check private DNS settings is normal, and test NO_INTERNET
      notification can be shown normally.
Change-Id: I715c766ad8e5eb54f4dc67239c1dbca7239506fc
2021-03-19 10:51:36 +08:00
Chiachang Wang
6f96bb4b34 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-19 08:39:07 +08:00
Remi NGUYEN VAN
1bdf4ba870 Remove Preconditions usage in TestNetworkSpecifier
Preconditions is a hidden API utility. It can be easily replace by
inline checks.

Bug: 177046265
Test: m
Change-Id: I3f722075fb9c74e12e40348ba4faad2f0fa67178
2021-03-19 00:35:27 +00:00
Remi NGUYEN VAN
c4dd8c9142 Revert "Revert "Remove connectivity dependency on Preconditions""
Preconditions.checkNotNull is deprecated to be replaced by
Objects.requireNonNull, and other methods can easily be replaced by
inline checks.

Preconditions is an internal API class that should not be used by
unbundled jars.

Bug: 177046265
Change-Id: I3a67d266b32142c034520acbcdc30f7213db5e13
Test: m
2021-03-19 00:35:27 +00:00
Chiachang Wang
d5034c7e9b 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-19 08:33:07 +08: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
Anthony Stange
e3e5f29233 Merge changes from topic "revert-1626206-replaceUidRange-MSYTKFNGUE" am: 2576238aec am: 37cb1551a0 am: a2c19b719d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1645768

Change-Id: Ia5cedb12112b04885c3f9270b9171c6494b8d2af
2021-03-18 18:29:41 +00:00
Lucas Lin
3606076fe1 Merge "Expose systemReady for SystemServer" am: 33737f6ac4 am: 7d2c52067f am: 91ee69fca8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1640142

Change-Id: I95488b39a32ed9086839eab6c457ed6f75472df1
2021-03-18 18:27:08 +00:00
Chiachang Wang
9bd228e4da Merge changes from topic "replaceUidRange" am: 7b582e9749 am: 38794c5290 am: 28f5f912c5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1626206

Change-Id: Ibc5e47f175a0e5433492f81068da9f42496e660b
2021-03-18 18:26:42 +00:00
Chiachang Wang
332f379a59 Merge "Expose APIs for Settings" am: 53178361ae am: 94e9fb339f am: 259c30a6de
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1644202

Change-Id: I13a56aa7dcc19efef3dc268fabfa52069360eb18
2021-03-18 18:26:16 +00:00
Chalard Jean
4ec606c49d Merge "Move constants to MODULE_LIB" am: 229cf59510 am: 39356af73f am: 80e68e5d1d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1640141

Change-Id: I514f5a3d1a4b1498f58170ac652ede394ddf6aeb
2021-03-18 18:24:57 +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
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
Paul Hu
9d73b70404 resolve merge conflicts of 82227141f6 to sc-dev
Bug: 182538166
Test: atest FrameworksNetTests
Change-Id: Idd5d75e0e9a7ad4f840b88da55d28fbaa2275dd0
2021-03-18 14:50:05 +00:00
Remi NGUYEN VAN
69f81f2ff7 Merge changes I4ad0ca60,I8a03162b into sc-dev
* changes:
  Expose isUidNetworkingBlocked and isUidRestrictedOnMeteredNetworks
  Add multipath preference, background status API
2021-03-18 14:07:12 +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
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
Remi NGUYEN VAN
4d49a1922a Migrate framework-connectivity internal resources
Use ServiceConnectivityResources instead.
Start by creating resources in the ServiceConnectivityResources package
to match the internal configuration, and common overlays.

Bug: 182125649
Test: device boots, has connectivity
Change-Id: I77a3efca2cd644f9828db1ed5d3cae8070fb8363
2021-03-18 09:02:13 +00:00
Remi NGUYEN VAN
d2f03002c9 Add connectivity protos to framework-connectivity
The protos are built separately by framework-connectivity from framework
protos, keeping only android.net protos for the connectivity jar.

Bug: 171860710
Test: m framework-connectivity.impl
Change-Id: I2c4a37ff2ee9e8efde49885feeafa27dcff7ca2c
2021-03-18 08:07:20 +00:00
Remi NGUYEN VAN
92f20605d8 Add multipath preference, background status API
Add APIs for getMultipathPreference and getRestrictBackgroundStatus.
Both are used by Connectivity to back the external
ConnectivityManager.getRestrictBackgroundStatus, and
ConnectivityManager.getMultipathPreference APIs.

Test: atest CtsNetTestCases
      atest ConnectivityServiceTests
      atest NetworkPolicyManagerServiceTest
Bug: 176289731
Change-Id: I8a03162b2f6691086bb64e75ffd354cdfca7f86a
2021-03-18 06:08:00 +00:00
Remi NGUYEN VAN
9416eece40 Merge "Add framework-connectivity.impl" am: 0fcb8d6db4 am: 74a87c1b2a am: 6e77056745
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1635039

Change-Id: Ief30f77f949669d9b52ae3a6fe84f8db91179841
2021-03-18 04:36:38 +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
Paul Hu
1ef84e6de6 Merge "Add ConnectivitySettingsManager" am: 3e17e82ab1 am: af229a6c7b am: b43a0ed287
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1641759

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

Change-Id: I0bb7aec183efdeed894447a3b5abc446b9ca46c8
2021-03-17 22:20:59 +00:00
Lucas Lin
d04269e96d Merge "Modify the comment of getPrivateDnsMode" am: de9a3af4de am: e0e9636048 am: 388c821087
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1640143

Change-Id: I60147e1c828e5d82556e58b67b8f138f63228e8f
2021-03-17 22:19:20 +00:00