Commit Graph

14181 Commits

Author SHA1 Message Date
Junyu Lai
86b155f624 [automerger skipped] Merge "[VCN15] expose addUnwantedCapability and related APIs" am: 20d187254b am: 4a074bc753 am: aec7499fca -s ours
am skip reason: skip tag Change-Id I3f2e6a99e015f09cc4405f6804eac4ae33e3dcc7 with SHA-1 ce8c92d956 is already in history

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

Change-Id: Id34011ffbdd997f29140b12cae5a0caeae745d3e
2021-03-23 14:03:13 +00:00
Lorenzo Colitti
2a4d6f6d43 Merge "Have a new method in NetworkAgentConfig.Builder to set allowBypass" am: c643098b0b am: 70e7af26c4 am: bb50fd24b3
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
56ad3fabe4 Merge changes I638ed5cd,I29f15571,I21a22ed1 am: 71996469d2 am: 068f44831d am: 12b8bb5c19
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1648068

Change-Id: I6d897cdcfb5b0e4809a32312071eb77623754f94
2021-03-23 14:01:19 +00:00
Aaron Huang
8be8042248 Merge "Remove Network, NetworkRequest metrics from jobscheduler" into sc-dev 2021-03-23 13:22:32 +00:00
Aaron Huang
457dda7eb4 Merge "Move deduceRestrictedCapability to libs/net and rename it" into sc-dev 2021-03-23 12:50:40 +00:00
TreeHugger Robot
e719bfb2bc Merge "Expose NetworkAgent constructor taking a NetworkScore parameter" into sc-dev 2021-03-23 12:45:24 +00:00
Lucas Lin
a652f6bec8 Merge "Expose NetworkScore to external caller" into sc-dev 2021-03-23 12:18:23 +00:00
TreeHugger Robot
0da9e8b1e7 Merge "Fix cannot find removeUnwantedCapability on R device" into sc-dev 2021-03-23 11:03:43 +00:00
Frank Li
2fdfc9fce8 Merge "[JS01]Remove hidden API usage of Connectivity Sevice" into sc-dev 2021-03-23 10:22:28 +00:00
Aaron Huang
f668c3b2b2 Remove Network, NetworkRequest metrics from jobscheduler
These metrics are deprecated so remove them from jobscheduler.
Also remove dumpDebug method from Network, NetworkRequest and
NetworkCapabilities because there's no caller anymore.

This change also for connectivity mainline module. These
three classes are inculded in framework-connectivity so
external module cannot have dependencies on its hidden API.
With this change, the dependencies can be removed.

Bug: 178777253
Test: FrameworksNetTests
      JobStoreTest
      adb shell dumpsys jobscheduler --proto
      CtsIncidentHostTestCases:JobSchedulerIncidentTest
Change-Id: Ie0c540303ba06b8fba029d2b98ae753afb08c963
2021-03-23 10:19:41 +00:00
junyulai
8428118d0f Fix cannot find removeUnwantedCapability on R device
Test: atest CtsNetTestCasesLatestSdk:android.net.NetworkCapabilitiesTest
Fix: 183473863
Change-Id: Icf2cda325795acee22a6c634e8d978f64c5ac3cb
2021-03-23 17:21:34 +08:00
Remi NGUYEN VAN
39d74d41ac Merge "Build service-connectivity with system_server API" into sc-dev 2021-03-23 09:18:53 +00:00
Remi NGUYEN VAN
f875d371c9 Merge "Add OsCompat" into sc-dev 2021-03-23 09:17:36 +00:00
Chiachang Wang
5c3c52975a 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
10d347a2fe 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
Remi NGUYEN VAN
5f100ec524 Merge "Remove NetdService, NetworkStackClient dependency" into sc-dev 2021-03-23 08:08:01 +00:00
Remi NGUYEN VAN
6f17b5020b Merge "Add NDK API for getprocnetwork" into sc-dev 2021-03-23 07:11:06 +00:00
Remi NGUYEN VAN
a146cf1de6 Build service-connectivity with system_server API
As all dependencies on hidden API have been removed, build
service-connectivity against system_server_current.

Bug: 171540887
Test: device boots, has connectivity
Change-Id: I454e8a0a8d0e0f9e6d21a8e8faf5a9e299962ad4
2021-03-23 06:06:03 +00:00
Remi NGUYEN VAN
64fe7cbfb4 Add OsCompat
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: I8d1a4811a1cc7dbc62f4033c2b320246d1d72b28
2021-03-23 06:06:02 +00:00
Remi NGUYEN VAN
e58b20025b Remove NetdService, NetworkStackClient dependency
Netd should be obtained via getSystemService, and
ModuleNetworkStackClient must be used instead of NetworkStackClient for
modules.

Bug: 171540887
Test: m
Change-Id: Ibe703ac56dd70673115cd8b95b44b856a7fc01f3
2021-03-23 06:05:52 +00:00
lifr
b22da4e252 [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
aec7499fca Merge "[VCN15] expose addUnwantedCapability and related APIs" am: 20d187254b am: 4a074bc753
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1639654

Change-Id: I6aee50f7f201361ae29e6442a0d28b79c6dfc1e2
2021-03-23 05:51:55 +00:00
Lorenzo Colitti
bb50fd24b3 Merge "Have a new method in NetworkAgentConfig.Builder to set allowBypass" am: c643098b0b am: 70e7af26c4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1649288

Change-Id: Ifa285f00d08e47877ab73a2eb1cefa3d493024d7
2021-03-23 05:51:32 +00:00
Junyu Lai
4a074bc753 Merge "[VCN15] expose addUnwantedCapability and related APIs" am: 20d187254b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1639654

Change-Id: Ie88ff422c473d3891a054fa75b5175b30c10cec9
2021-03-23 05:27:53 +00:00
Lorenzo Colitti
70e7af26c4 Merge "Have a new method in NetworkAgentConfig.Builder to set allowBypass" am: c643098b0b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1649288

Change-Id: I71d541b3578169410349356a149528954e1c8789
2021-03-23 05:18:03 +00:00
Junyu Lai
20d187254b Merge "[VCN15] expose addUnwantedCapability and related APIs" 2021-03-23 05:02:22 +00:00
Lorenzo Colitti
c643098b0b Merge "Have a new method in NetworkAgentConfig.Builder to set allowBypass" 2021-03-23 04:40:50 +00:00
Lorenzo Colitti
12b8bb5c19 Merge changes I638ed5cd,I29f15571,I21a22ed1 am: 71996469d2 am: 068f44831d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1648068

Change-Id: Ia0b6ffa74536e3f20f13282d08bd858fc9e979bf
2021-03-23 02:10:45 +00:00
Frank Li
133793bd46 Merge "[TL02]Remove hidden API usage of NetworkAgent" into sc-dev 2021-03-23 02:03:59 +00:00
lifr
cbe8c09525 [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
068f44831d Merge changes I638ed5cd,I29f15571,I21a22ed1 am: 71996469d2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1648068

Change-Id: I74e0c3eae3bf22c9a05968e2daf5b59da33f01bb
2021-03-23 01:37:03 +00:00
Lorenzo Colitti
71996469d2 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
bd2dcae9a3 Merge "[VCN15] expose addUnwantedCapability and related APIs" into sc-dev 2021-03-23 01:19:39 +00:00
Remi NGUYEN VAN
5aee36bf7e Add NDK API for getprocnetwork
The API is the getter couterpart for setprocnetwork.
Use it in NetworkUtils so that the NDK API can be the source of truth
for the process network.

Bug: 171540887
Test: atest CtsNetTestCases
      Tests in change I311b58585033c2ca50ce5477ea9cd94b6f127507
Change-Id: Ie8f68cf1fa57deddb63324c1abf3d6fd5b0ef500
2021-03-23 01:01:06 +00:00
lucaslin
c276e2bb77 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
Chiachang Wang
64b0316000 [automerger skipped] Expose uids related APIs in NetworkRequest and NetworkCapabilities am: fd13f9223f -s ours am: 712d3a0579 -s ours
am skip reason: skip tag Change-Id I107c329d4d7130d488772166eae8b5e7aaa2ff04 with SHA-1 6f96bb4b34 is already in history

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

Change-Id: I382cbac60469250d2be5a2ffb2fb51eafa082548
2021-03-22 19:56:22 +00:00
Chiachang Wang
141e8b92d3 [automerger skipped] Replace the usage of UidRange am: e0ace0533c -s ours am: 9421da680e -s ours
am skip reason: skip tag Change-Id I4e5aec6ef1ea02e038fcd7ed117a3b67b69c5cb9 with SHA-1 d5034c7e9b is already in history

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

Change-Id: Iedbd693caaa772adde8188c19bb17b2800fa6774
2021-03-22 19:56:15 +00:00
Joshua Mccloskey
77127b6b03 Merge "Revert "Have a new method in NetworkAgentConfig.Builder to set allowBypass"" into sc-dev 2021-03-22 19:20:20 +00:00
Chiachang Wang
712d3a0579 [automerger skipped] Expose uids related APIs in NetworkRequest and NetworkCapabilities am: fd13f9223f -s ours
am skip reason: skip tag Change-Id If76877e6bde7abe3b5ddde078f87eefd027e675c with SHA-1 b40480c2ea is already in history

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

Change-Id: I1072a17b5977b5c2c4fdb8e04c59298c59c0d3c3
2021-03-22 19:12:39 +00:00
Chiachang Wang
9421da680e [automerger skipped] Replace the usage of UidRange am: e0ace0533c -s ours
am skip reason: skip tag Change-Id Idb7f353788c5779a4fbbd107595e9326b99fe0a8 with SHA-1 c347b9c341 is already in history

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

Change-Id: I3e7a0c612ee4ca37bf5567d5ec1297cf14671337
2021-03-22 19:12:32 +00:00
Joshua Mccloskey
f5df095388 Revert "Have a new method in NetworkAgentConfig.Builder to set allowBypass"
This reverts commit d40b253b3d.

Reason for revert: Broken build b/183416288

Change-Id: Id9ec9fb98b8f88eeb7db1d1442d76456aaf350d1
2021-03-22 18:55:32 +00:00
Chiachang Wang
0bf318fcd7 [automerger skipped] Expose uids related APIs in NetworkRequest and NetworkCapabilities am: b40480c2ea -s ours
am skip reason: skip tag Change-Id I107c329d4d7130d488772166eae8b5e7aaa2ff04 with SHA-1 6f96bb4b34 is already in history

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

Change-Id: I6a340c70cddb97cae8db045c93efb840d590dc5c
2021-03-22 18:50:14 +00:00
Chiachang Wang
e955a30ece [automerger skipped] Replace the usage of UidRange am: c347b9c341 -s ours
am skip reason: skip tag Change-Id I4e5aec6ef1ea02e038fcd7ed117a3b67b69c5cb9 with SHA-1 d5034c7e9b is already in history

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

Change-Id: I8baf4176730743ea317fda6aaff56a5a59b55986
2021-03-22 18:49:58 +00:00
lucaslin
d40b253b3d 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
fd13f9223f 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
Merged-In: I107c329d4d7130d488772166eae8b5e7aaa2ff04
Merged-In: If76877e6bde7abe3b5ddde078f87eefd027e675c
Change-Id: If76877e6bde7abe3b5ddde078f87eefd027e675c
2021-03-23 01:34:54 +09:00
Chiachang Wang
b40480c2ea 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
Merged-In: I107c329d4d7130d488772166eae8b5e7aaa2ff04
Change-Id: If76877e6bde7abe3b5ddde078f87eefd027e675c
2021-03-23 01:33:16 +09:00
Chiachang Wang
e0ace0533c 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
Merged-In: I4e5aec6ef1ea02e038fcd7ed117a3b67b69c5cb9
Merged-In: Idb7f353788c5779a4fbbd107595e9326b99fe0a8
Change-Id: Idb7f353788c5779a4fbbd107595e9326b99fe0a8
2021-03-23 01:11:20 +09:00
Chiachang Wang
c347b9c341 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
Merged-In: I4e5aec6ef1ea02e038fcd7ed117a3b67b69c5cb9
Change-Id: Idb7f353788c5779a4fbbd107595e9326b99fe0a8
2021-03-23 01:02:00 +09:00
Remi NGUYEN VAN
d4c4f8665d Merge "Remove ConnectivityService hidden annotations" into sc-dev 2021-03-22 14:41:51 +00:00
Aaron Huang
1fc20d4fa7 Move deduceRestrictedCapability to libs/net and rename it
NetworkCapabilities is included in framework-connectivity, so external
module cannot have dependencies on its hidden API. Move the method to
libs/net so that external modules can use it by including the library.

Bug: 178777253
Test: FrameworksNetTests
Change-Id: I77970b3a5e5e0e9d263639694b1f06519169bf64
2021-03-22 22:35:10 +08:00