Commit Graph

188 Commits

Author SHA1 Message Date
Chiachang Wang
ec75643ad4 Merge "Add startCaptivePortalApp to system API" 2021-03-19 11:30:20 +00:00
Chalard Jean
a302dd292f Merge "[NS03] Mix in other CS-managed properties" 2021-03-19 10:32:46 +00:00
Lucas Lin
5af3cd8e55 Merge "Expose getCapabilities" 2021-03-19 10:24:25 +00:00
Chalard Jean
fbc54675e5 [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
0dfbc82b89 [NS02] Mix in validation of the score
Test: FrameworksNetTests FrameworksWifiTests NetworkStackTests
Change-Id: I9cac3a05ad0c4008599973b12d2c5e4c02233a5c
2021-03-19 13:50:56 +09:00
Treehugger Robot
7a81a915a5 Merge "CaptivePortalData: use CharSequence in VenueFriendlyName API" 2021-03-19 04:13:36 +00:00
Remi NGUYEN VAN
e461c56b71 Merge "Add InetAddressCompat" 2021-03-18 23:58:16 +00:00
Remi NGUYEN VAN
bc438826c8 Merge "Move network selection utils to Connectivity" 2021-03-18 23:57:34 +00:00
Anthony Stange
d6aa01e9f7 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
1b5c01b06f 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
43b606da89 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
e3fa0dd7ab 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
e1b04f6483 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
Remi NGUYEN VAN
4cf96ab3cc Add startCaptivePortalApp to system API
The API is already used by settings and should be usable by setup
wizards. It is the only way for a caller outside of the system_server to
trigger the captive portal application.

The API is already CTS tested in android.net.cts.CaptivePortalTest.

Fixes: 182871577
Test: atest CtsNetTestCases:android.net.cts.CaptivePortalTest
Change-Id: Ie8d9a546b54524ba837715baa94a07d1f993d8d3
2021-03-18 22:41:00 +08:00
Lucas Lin
1235582921 Merge "Expose systemReady for SystemServer" 2021-03-18 13:40:54 +00:00
Chiachang Wang
5f1f32682a 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
4b111a2d31 Merge "Expose APIs for Settings" 2021-03-18 13:27:47 +00:00
lucaslin
87911596ee 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
75915bad98 Merge "Move constants to MODULE_LIB" 2021-03-18 12:29:38 +00:00
Paul Hu
04db2842e6 Merge "Add more connectivity module settings" 2021-03-18 12:22:55 +00:00
paulhu
56e09df8db 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
4d51357114 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
3f64a338e5 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
347208541a 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
0843e480ca 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
83adad7210 Merge "Add ConnectivitySettingsManager" 2021-03-17 14:57:32 +00:00
Remi NGUYEN VAN
e498d6c49b Merge "Remove Protocol.BASE_* usage in Connectivity" 2021-03-17 14:53:26 +00:00
Remi NGUYEN VAN
a902c7cc88 Merge "Remove extra comment" 2021-03-17 12:16:09 +00:00
Remi NGUYEN VAN
1fb66ad1d3 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
Remi NGUYEN VAN
0d4c38d9c4 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
90a7a51e0a 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
7abe7e01a9 Modify the comment of getPrivateDnsMode
Bug: 172183305
Test: m
Change-Id: I2f1b44cf2a362b42f052ea5d34a5cec03d46e661
2021-03-17 14:53:35 +08:00
Lucas Lin
60b3e230b6 Merge "Change the parameter type from ContentResolver to Context" 2021-03-17 06:35:21 +00:00
lucaslin
7fc930b4ca 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
2021-03-17 14:16:55 +08:00
Chalard Jean
b43f3963bc 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
2021-03-17 14:59:24 +09:00
Chalard Jean
85538adb19 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
2021-03-17 05:48:18 +00:00
Hai Shalom
871ba42cf7 CaptivePortalData: use CharSequence in VenueFriendlyName API
Following up on feedback from API council, change the String type
to CharSequence in the get and set Venue friendly name API.

Bug: 179163405
Test: atest ConnectivityServiceTest CtsNetTestCasesLatestSdk:CaptivePortalDataTest
Test: atest NetworkNotificationManagerTest NetworkMonitorTest
Change-Id: Ia63974cd2ff5975bde410eb93731d4b1def36d19
2021-03-16 20:59:42 -07:00
Remi NGUYEN VAN
032cd3914a Merge "Remove MessageUtils usage in VpnTransportInfo" 2021-03-17 00:14:10 +00:00
junyulai
8eb13a2b3d [VCN14] Expose registerBestMatchingNetworkCallback
Test: m -j doc-comment-check-docs
Bug: 175662146
Change-Id: Ie67dd2f4f8d973de37bc64a03908d7cbb7c2b7ad
2021-03-16 21:30:56 +08:00
junyulai
1b1c874db4 [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
2021-03-16 21:30:55 +08:00
Paul Hu
01a8210f33 Merge "Replace interal okhttp APIs" 2021-03-16 12:18:49 +00:00
Chalard Jean
6010c00ecd 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
2021-03-16 12:14:00 +00:00
Chalard Jean
b5a139f32a Implement setNetworkPreferenceForUser.
Test: FrameworksNetTests
Change-Id: I8f18083b5857289892fe8adea5f5ea3f5dbe0809
2021-03-16 12:13:46 +00:00
Chalard Jean
fa45a68c91 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
2021-03-16 12:13:27 +00:00
lucaslin
20f0488017 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
2021-03-16 09:26:57 +00:00
Lucas Lin
de22605a9a Merge "Add comments to describe the value of converting hex to decimal" 2021-03-16 08:31:10 +00:00
Lucas Lin
6228e2c6c8 Merge "Have a new API to get private DNS mode" 2021-03-16 07:39:35 +00:00
Chalard Jean
0e6446cc22 Merge "[NS01] Add NetworkScore" 2021-03-16 06:36:07 +00:00
Remi NGUYEN VAN
32aa7de40d Merge "Add ParseException constructors to API" 2021-03-16 06:25:16 +00:00
paulhu
405d8911e9 Replace interal okhttp APIs
Connectivity is becoming a mainline module in S but mainline
modules are not allowed to use non-formal APIs. Thus, replace
internal okhttp APIs to stable libcore APIs which are created for
using HttpURLConnectionFactory.

Bug: 182238821
Test: atest FrameworksNetTests
Change-Id: I56ba1b9e6e94f9c6519c3f1c8f0c5993fccbe185
2021-03-15 23:06:15 +08:00