Commit Graph

275 Commits

Author SHA1 Message Date
lifr
c4fd62072b [TL02]Remove hidden API usage of NetworkAgent
The connection service will become the mainline module.
Remove the hidden API usage of NetworkAgent.

Bug: 170598012
CTS-Coverage-Bug: 170598012
Test: atest FrameworksNetTests FrameworksTelephonyTests
      atest FrameworksWifiTests
Change-Id: I4e4040ae7f94bdf479c7df9ec2ffabafbe06331c
2021-03-23 02:01:38 +00:00
Lorenzo Colitti
750e8ca69e Merge changes I638ed5cd,I29f15571,I21a22ed1
* changes:
  Expose registerDefaultNetworkCallbackAsUid.
  Support calling registerDefaultNetworkCallback for another UID.
  Store the effective UID in NetworkRequestInfo.
2021-03-23 01:27:58 +00:00
Lorenzo Colitti
1cd2428be0 Merge "[VCN15] expose addUnwantedCapability and related APIs" into sc-dev 2021-03-23 01:19:39 +00:00
lucaslin
0e345e9b1a Have a new method in NetworkAgentConfig.Builder to set allowBypass
Have a new method in NetworkAgentConfig.Builder for Vpn to set
allowBypass.

Bug: 182963397
Test: m
Change-Id: I3f244464438325ee7f8a1b953d3fb28186293628
2021-03-23 09:01:40 +09:00
Joshua Mccloskey
02da918919 Revert "Have a new method in NetworkAgentConfig.Builder to set allowBypass"
This reverts commit 974644dd3c.

Reason for revert: Broken build b/183416288

Change-Id: Id9ec9fb98b8f88eeb7db1d1442d76456aaf350d1
2021-03-22 18:55:32 +00:00
lucaslin
974644dd3c Have a new method in NetworkAgentConfig.Builder to set allowBypass
Have a new method in NetworkAgentConfig.Builder for Vpn to set
allowBypass.

Bug: 182963397
Test: m
Change-Id: I3f244464438325ee7f8a1b953d3fb28186293628
2021-03-22 18:44:48 +00:00
Chiachang Wang
577911cc62 Merge "Add NetworkRequest.Builder creating from an existing instance" into sc-dev 2021-03-22 13:17:43 +00:00
Chiachang Wang
7625498617 Add NetworkRequest.Builder creating from an existing instance
Provide a formal way to construct a new NetworkRequest from an
existing instance. The network capabilities inside the
NetworkRequest is hidden. There is no way to pass a
NetworkRequest and update its capabilities. Add
NetworkRequest.Builder creating from an existing instance to
allow to clone the network capabilities.

Bug: 172183305
Test: make update-api
Change-Id: I068462b2a1410daf67b0c95f2b643d396f079531
CTS-Coverage-Bug: 172183305
2021-03-22 13:05:10 +00:00
Jayachandran Chinnakkannu
687d2a3118 Merge "Swap parameters in QosCallback#registerQosCallback" am: dcc2fb2a19 am: 507df2663e am: 2e744846a0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1628901

Change-Id: Ice84bb2e6d855ed88e7e432cf49739e69c9e01de
2021-03-22 12:30:40 +00:00
junyulai
e76b5f7004 [VCN15] expose addUnwantedCapability and related APIs
Test: m -j doc-comment-check-docs
Bug: 175662146
Change-Id: I3f2e6a99e015f09cc4405f6804eac4ae33e3dcc7
2021-03-22 11:11:26 +00:00
Lorenzo Colitti
b90bdbdbf4 Expose registerDefaultNetworkCallbackAsUid.
Bug: 165835257
Test: atest FrameworksNetTests
Change-Id: I638ed5cd5273d456919630aba1e22f099df1b36c
2021-03-22 19:50:27 +09:00
junyulai
b15b7dbdd4 [VCN15] expose addUnwantedCapability and related APIs
Test: m -j doc-comment-check-docs
Bug: 175662146
Merged-In: I3f2e6a99e015f09cc4405f6804eac4ae33e3dcc7
Change-Id: I3f2e6a99e015f09cc4405f6804eac4ae33e3dcc7
  (cherry-picked from ag/13929102)
2021-03-22 16:51:50 +08:00
lucaslin
97fb10a3a6 Expose some APIs from ConnectivityManager
- Expose setRequireVpnForUids to Vpn.java
- Expose setLegacyLockdownVpnEnabled to LockdownVpnTracker.java
- Expose requestRouteToHostAddress to
  GnssNetworkConnectivityHandler.java

Bug: 182963397
Test: m
Change-Id: I1fb5ecfbe37878ba3534e6c6c7599ca29db2735c
2021-03-22 11:51:27 +08:00
Jayachandran Chinnakkannu
507df2663e Merge "Swap parameters in QosCallback#registerQosCallback" am: dcc2fb2a19
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1628901

Change-Id: I2c371b6f1dc25f84a389480e46d9d582e9da148b
2021-03-22 03:18:17 +00:00
Jayachandran Chinnakkannu
dcc2fb2a19 Merge "Swap parameters in QosCallback#registerQosCallback" 2021-03-21 21:02:36 +00:00
Roshan Pius
122fc06389 resolve merge conflicts of 454f122745 to stage-aosp-master
Merged-In: Ib9d7923104ac0a60f6af5a3a2d2b7f13bc0262e3
Change-Id: Ib9d7923104ac0a60f6af5a3a2d2b7f13bc0262e3
2021-03-21 19:20:35 +00:00
Roshan Pius
1e97e45498 resolve merge conflicts of 403b7fd0b0a6736bcee1817fb5c774f8c8a040de to stage-aosp-master
Change-Id: Ib9d7923104ac0a60f6af5a3a2d2b7f13bc0262e3
2021-03-21 19:16:33 +00:00
Treehugger Robot
454f122745 Merge changes from topics "revert-1645768-revert-1626206-replaceUidRange-MSYTKFNGUE-HIUTVTIGIR", "ti_redaction"
* changes:
  TransportInfo: Add a generic redaction mechanism
  Revert "Revert "Expose uids related APIs in NetworkRequest and N..."
  Revert^2 "Replace the usage of UidRange"
2021-03-21 16:41:13 +00:00
Roshan Pius
e2d2838805 TransportInfo: Add a generic redaction mechanism
This replaces the existing mechanism for redacting location sensitive
fields with a more extensible mechanism. Currently supported redactions
are for the following permissions:
i. ACCESS_FINE_LOCATION
ii. LOCAL_MAC_ADDRESS
iii. NETWORK_SETTINGS

Also, removed WifiInfo from ConnectivityServiceTest to reduce cross
dependencies on wifi code.

Bug: 156867433
Bug: 162602799
Test: atest android.net
Test: atest com.android.server
Change-Id: I2bb980c624667a55c1383f13ab71b9b97ed6eeab
2021-03-19 20:15:21 +00:00
Chalard Jean
4be4b3eee7 Merge "Reland: CaptivePortalData: use CharSequence in VenueFriendlyName API" into sc-dev 2021-03-19 14:26:06 +00:00
Chiachang Wang
abe928e7eb Merge "Add startCaptivePortalApp to system API" am: 1756295fc5 am: c5472a3cf7 am: 8020cb4517
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1639899

Change-Id: Ia3be29892f62b82d23a165bc8334a083c674aefb
2021-03-19 13:09:03 +00:00
Lucas Lin
7ead06e186 Merge "Expose getCapabilities" am: ca98471c77 am: f21c73b7ad am: 00a76b180b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1641919

Change-Id: I9a6b6f405ee4b7d5d03173d6c5e22e1018dc3417
2021-03-19 11:32:07 +00:00
Chiachang Wang
1756295fc5 Merge "Add startCaptivePortalApp to system API" 2021-03-19 11:30:20 +00:00
Chiachang Wang
473b69519b Merge "Expose constants of ConnectivityManager" into sc-dev 2021-03-19 10:40:49 +00:00
Lucas Lin
ca98471c77 Merge "Expose getCapabilities" 2021-03-19 10:24:25 +00:00
Hai Shalom
60372ff53d Reland: 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: Ifa3ea9aae0cabf5757791c4ae13e6f551759ed97
2021-03-19 09:40:34 +00:00
Remi NGUYEN VAN
d9b56cea16 Revert "CaptivePortalData: use CharSequence in VenueFriendlyName API"
This reverts commit 6ae29ff41a.

Reason for revert: b/183174863
Bug: 183174863

Change-Id: I4db923e112bba149f4e8eb4cfa8c3f97defd5e63
2021-03-19 08:10:35 +00:00
Treehugger Robot
33457035e7 Merge "CaptivePortalData: use CharSequence in VenueFriendlyName API" 2021-03-19 04:13:36 +00:00
lucaslin
cf6d450eb8 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
628cb1187e Revert "Revert "Expose uids related APIs in NetworkRequest and N..."
Revert^2 "Add shims for NetworkRequest"

b72b3ca768fc25ef72dc78f1396b08447b8ef5c6

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: I4b8e1aa558e3459a932535f9901f4ae86b0ecb67
Merged-In: I107c329d4d7130d488772166eae8b5e7aaa2ff04
2021-03-19 02:12:17 +00:00
Chiachang Wang
aacf237c27 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
Anthony Stange
35b926cc47 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
fa6349a6c7 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
8238a7665a 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
56564e061c Merge "Expose systemReady for SystemServer" 2021-03-18 13:40:54 +00:00
Chiachang Wang
268a9f56f2 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
e584943ca1 Merge "Expose APIs for Settings" 2021-03-18 13:27:47 +00:00
lucaslin
8e0c1f0850 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
8c288603d1 Merge "Move constants to MODULE_LIB" 2021-03-18 12:29:38 +00:00
Chiachang Wang
f9294e7cd1 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
Chiachang Wang
0c32e09028 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
Lucas Lin
253a041a13 Merge "Change the parameter type from ContentResolver to Context" 2021-03-17 06:35:21 +00:00
lucaslin
10774b7ebc 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
bef6b09cd9 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
24a9b5cad6 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
611b02178d 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
junyulai
bd1230675e [VCN14] Expose registerBestMatchingNetworkCallback
Test: m -j doc-comment-check-docs
Bug: 175662146
Change-Id: Ie67dd2f4f8d973de37bc64a03908d7cbb7c2b7ad
2021-03-16 21:30:56 +08:00
Chalard Jean
0a4aefcec2 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
lucaslin
e2cd02d9ab 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
b79ae17835 Merge "Have a new API to get private DNS mode" 2021-03-16 07:39:35 +00:00