Commit Graph

292 Commits

Author SHA1 Message Date
TreeHugger Robot
eb04adf4bc Merge "Move BLOCKED_REASON_* constants from NPMS into ConnectivityManager." into sc-dev 2021-03-24 16:02:56 +00:00
Sarah Chin
3c405692ad Merge "API to get network visible network capability name" into sc-dev 2021-03-24 05:27:45 +00:00
Jayachandran C
d57b2853a3 Add 5G/NR QOS support
Bug: 155176305
Bug: 182317794
Test: atest ConnectivityServiceTest
      atest QosCallbackTrackerTest

Change-Id: Idf6d8a7c3b80bc50a2c1244ceaefea9381d40c2f
2021-03-23 19:14:21 -07:00
Sarah Chin
34fbbbb6b9 API to get network visible network capability name
Test: atest DataConnectionTest, DcTrackerTest
Bug: 181916712
CTS-Coverage-Bug: 183553812
Change-Id: Iae63ac4d62641cee2bd0f0c5f50dd729750d514c
2021-03-24 00:27:11 +00:00
Sudheer Shanka
1d0d9b4627 Move BLOCKED_REASON_* constants from NPMS into ConnectivityManager.
These constants will now be including all the reasons for why an
uid's network access can be blocked, instead of only the
restrictions that could be imposed by NPMS.

Bug: 183473548
Test: atest ./tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Ignore-AOSP-First: Merging internally first to handle conflicts.
Change-Id: I4c544415e12adf442fd2415c371b1b70a39c3aa4
2021-03-23 15:26:29 -07:00
Lorenzo Colitti
d86c8c2c8a Merge "Have a new method in NetworkAgentConfig.Builder to set allowBypass" am: 1a6e0ea3fd am: 17b490ed13 am: 5a0360c6a1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1649288

Change-Id: Ibc6553b1471ee8e0ab362979ba9525c2e328a275
2021-03-23 14:02:47 +00:00
Lorenzo Colitti
f7cf543a86 Merge changes I638ed5cd,I29f15571,I21a22ed1 am: 750e8ca69e am: b1fbb5ca62 am: 787caa8c08
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1648068

Change-Id: I6d897cdcfb5b0e4809a32312071eb77623754f94
2021-03-23 14:01:19 +00:00
TreeHugger Robot
3cccf48918 Merge "Expose NetworkAgent constructor taking a NetworkScore parameter" into sc-dev 2021-03-23 12:45:24 +00:00
Lucas Lin
d8e8a9557b Merge "Expose NetworkScore to external caller" into sc-dev 2021-03-23 12:18:23 +00:00
Chiachang Wang
074c7d7537 Merge "Add NetworkRequest.Builder creating from an existing instance" 2021-03-23 10:46:20 +00:00
Chiachang Wang
3ee63e5132 Expose NetworkAgent constructor taking a NetworkScore parameter
Vpn constructs NetworkAgent with this exposed NetworkAgent
constructor. Given NetworkAgent is moving into the incoming
connectivity module, Vpn which is outside the module will not
be able to access it if it's not in the API surface. Thus,
expose it to allow Vpn to use it.

Bug: 182963397
Test: make update-api
Change-Id: Ic2357dcfff3233e0dd17b48b0e376a5095ef60fa
CTS-Coverage-Bug: 172183305
2021-03-23 08:51:05 +00:00
lucaslin
18158aa33b Expose NetworkScore to external caller
NetworkScore will be a part of mainline module, so the external
callers cannot call its hidden APIs. Expose needed APIs to
the external callers.

CTS-Coverage-Bug: 182963397
Bug: 182963397
Test: m
Change-Id: Iddf8c71a5f51a40bc6ff78626b3e8ee530d1b7eb
2021-03-23 16:17:37 +08:00
Chiachang Wang
e2179dd1cc 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
Merged-In: I068462b2a1410daf67b0c95f2b643d396f079531
2021-03-23 14:50:03 +08:00
lifr
308bcccd2b [JS01]Remove hidden API usage of Connectivity Sevice
The Connectivity service will become the mainline module.
Therefore, remove the caller of using Connectivity's
hidden API outside the module and expose the required
connectivity API used in Jobscheduler.

Bug: 183456204
CTS-Coverage-Bug: 170598012
Test: atest JobStoreTest
Change-Id: Ie6bc81ff382fb242b98f35d28a96defc207c7987
2021-03-23 13:58:48 +08:00
Junyu Lai
84ebe6693a Merge "[VCN15] expose addUnwantedCapability and related APIs" 2021-03-23 05:02:22 +00:00
Lorenzo Colitti
1a6e0ea3fd Merge "Have a new method in NetworkAgentConfig.Builder to set allowBypass" 2021-03-23 04:40:50 +00:00
Frank Li
6fa238f167 Merge "[TL02]Remove hidden API usage of NetworkAgent" into sc-dev 2021-03-23 02:03:59 +00:00
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