Commit Graph

14147 Commits

Author SHA1 Message Date
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
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
bd2dcae9a3 Merge "[VCN15] expose addUnwantedCapability and related APIs" into sc-dev 2021-03-23 01:19:39 +00: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
Chiachang Wang
99cf352cd1 Merge "Add NetworkRequest.Builder creating from an existing instance" into sc-dev 2021-03-22 13:17:43 +00:00
Chiachang Wang
c2e79ada6c 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
Lorenzo Colitti
90acad1251 Merge changes I90bf7957,If58524b0 am: 029ba17cb0 am: c3e38ade53 am: b08e5aba25
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1646972

Change-Id: I0420784d706f64b05137074bfcfb58cdc232b83b
2021-03-22 12:34:17 +00:00
Chiachang Wang
adb8328ed1 [automerger skipped] Merge "Revert "Correct the logic in NetworkCapabilitiesTest"" am: 3f603fae13 -s ours am: 60450deb67 am: 7007e04119
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1645005

Change-Id: I0317175e5c25616addd0b651d48ce47d61503f00
2021-03-22 12:33:45 +00:00
Treehugger Robot
0f324fc005 [automerger skipped] Merge "Correct the logic in NetworkCapabilitiesTest" am: 58f4cdf3b3 -s ours am: 8297bc95a0 am: d914ad7ad9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1640144

Change-Id: I52d135904ffc8cb4aae0166deb7bfaedc969a583
2021-03-22 12:33:19 +00:00
Remi NGUYEN VAN
8908af0828 [automerger skipped] Merge "Remove Preconditions usage in TestNetworkSpecifier" am: afdb6a7347 am: 6a4a9423ef am: 8b4738d3b3 -s ours
am skip reason: skip tag Change-Id I3f722075fb9c74e12e40348ba4faad2f0fa67178 with SHA-1 1bdf4ba870 is already in history

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

Change-Id: I26d0bb14c35b17086f66a4dfc6d7f727d9940cf2
2021-03-22 12:32:55 +00:00
Remi NGUYEN VAN
751124c98c [automerger skipped] Merge "Revert "Revert "Remove connectivity dependency on Preconditions""" am: aa1d743312 am: 5024171a1f am: e6fb8c44dd -s ours
am skip reason: skip tag Change-Id I3a67d266b32142c034520acbcdc30f7213db5e13 with SHA-1 c4dd8c9142 is already in history

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

Change-Id: I2d568af3f71ae143c535090487b0b85754421fa6
2021-03-22 12:32:34 +00:00
Automerger Merge Worker
da66d09a7a Merge "Merge "Add TEST_MAPPING for Connectivity" am: b2fe416e82 am: 1a7066d0a5 am: 0847f57ff9" into sc-dev 2021-03-22 12:32:25 +00:00
Remi NGUYEN VAN
92dcd3a24c Merge "Remove hidden Icon.createWithResource API usage" into sc-dev 2021-03-22 12:32:22 +00:00
Remi NGUYEN VAN
4d9190f91e Merge "Add TEST_MAPPING for Connectivity" am: b2fe416e82 am: 1a7066d0a5 am: 0847f57ff9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1646851

Change-Id: Iab1ad1723dd4cb4d4652b23d8499c0b05deca7ad
2021-03-22 12:32:08 +00:00
Treehugger Robot
8cfb7d0076 Merge "Move trimV4AddrZeros to libs/net" am: 33b1df7ec4 am: dea1480c0b am: 4345a9b287
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1636022

Change-Id: I7908772ff2f3b2c5fc1dd9a3510fce0f7ee78ba5
2021-03-22 12:31:39 +00:00
Remi NGUYEN VAN
9f092d566f Merge "Add SystemMessages protos to Connectivity" am: cf638d345b am: 02e5fcf301 am: 3b780f79d3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1626204

Change-Id: Ia8a06a0d6f5dcdbdc672149ff206aada83478f23
2021-03-22 12:31:07 +00:00
Jayachandran Chinnakkannu
4e273df7e5 Merge "Swap parameters in QosCallback#registerQosCallback" am: fce4049a1d am: f3f342370a am: 61bfb06808
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1628901

Change-Id: Ice84bb2e6d855ed88e7e432cf49739e69c9e01de
2021-03-22 12:30:40 +00:00
Roshan Pius
fd994c97a2 [automerger skipped] resolve merge conflicts of d2c4f1d6c8 to stage-aosp-master am: 39ff19da2f am: c8ed8dce59 -s ours
am skip reason: skip tag Change-Id Ib9d7923104ac0a60f6af5a3a2d2b7f13bc0262e3 with SHA-1 332e7a241a is already in history

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

Change-Id: I945ee90092cf1f8001a92b72a66373d92fbcd326
2021-03-22 12:28:37 +00:00
Chiachang Wang
56294457bd [automerger skipped] Revert "Revert "Expose uids related APIs in NetworkRequest and N..." am: 8d81c8d76b -s ours am: 9991401b9d -s ours am: 7d909af3bb -s ours
am skip reason: skip tag Change-Id I107c329d4d7130d488772166eae8b5e7aaa2ff04 with SHA-1 6f96bb4b34 is already in history

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

Change-Id: I9986ddce8827a85982b0846e18044fc45ec95c24
2021-03-22 12:28:01 +00:00
Lorenzo Colitti
03f2900d0a [automerger skipped] Merge changes from topic "backport-connectivityresources" am: a31a7b1bf4 am: dd37a5d576 am: a043655e3a -s ours
am skip reason: skip tag Change-Id Ic0d24d36af0b87153d527083f8964ddc6cd78482 with SHA-1 9d239b5515 is already in history

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

Change-Id: Ie24e96154851ddeac6971e4bfa49a0eb43e5915c
2021-03-22 12:27:31 +00:00
Lorenzo Colitti
b28d29738c [automerger skipped] Cherry-pick some test changes from ag/13210542. am: e7963a1d82 am: eb0dc8f775 am: 28a89348a9 -s ours
am skip reason: skip tag Change-Id I35d28c8df341dbbac2774026c6ca749e296c0482 with SHA-1 3aa6043c46 is already in history

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

Change-Id: I886ca8978862d2dacc11d2bd5d4977698e953935
2021-03-22 12:27:21 +00:00
Remi NGUYEN VAN
530bffa889 [automerger skipped] Add connectivity protos to framework-connectivity am: 953819d7f0 am: 00b56b8d0d am: 30c4960d7e -s ours
am skip reason: skip tag Change-Id I2c4a37ff2ee9e8efde49885feeafa27dcff7ca2c with SHA-1 d2f03002c9 is already in history

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

Change-Id: I593f9d014d29a8041c9acbe1f3034f15613c88b5
2021-03-22 12:27:12 +00:00
paulhu
a98994a3f5 [automerger skipped] Remove unused NetworkPolicyManagerInternal in CS am: c850635440 am: 143739703d am: 634e8a5b2a -s ours
am skip reason: skip tag Change-Id I8719ef2e96e7db9da2894b467b9e7a1bc09de386 with SHA-1 d97c467e2a is already in history

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

Change-Id: I3bfe4457a7b9f3a0b7f2f3604f0f1745c96cb7bb
2021-03-22 12:26:52 +00:00
Remi NGUYEN VAN
fbc44046d9 [automerger skipped] Move connectivity AIDLs to android.net am: 6ed4472b63 am: e6fe8b4103 am: 909eb08445 -s ours
am skip reason: skip tag Change-Id I611f1941698c574e37aea912ee76dadc8b32e41a with SHA-1 8ffe4eb5e3 is already in history

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

Change-Id: Ice5060b366cfb6cbce6e6151f2fb1a1208e9b939
2021-03-22 12:26:41 +00:00
Remi NGUYEN VAN
18c08a91be [automerger skipped] Migrate framework-connectivity internal resources am: 8e12782094 am: 1f00de9e81 am: 50fab6449d -s ours
am skip reason: skip tag Change-Id I77a3efca2cd644f9828db1ed5d3cae8070fb8363 with SHA-1 4d49a1922a is already in history

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

Change-Id: I17ffd47283c43a6df1e61ca9ef864ca32d99e4e9
2021-03-22 12:26:31 +00:00
Remi NGUYEN VAN
7e85f08312 [automerger skipped] Add multipath preference, background status API am: 0f91b7a19a am: 6f3429172b am: 3f139e72f6 -s ours
am skip reason: skip tag Change-Id I8a03162b2f6691086bb64e75ffd354cdfca7f86a with SHA-1 92f20605d8 is already in history

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

Change-Id: I147c04bb30ed920679d88cd765b7517ca4fbd12e
2021-03-22 12:26:13 +00:00
junyulai
ce8c92d956 [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
b08e5aba25 Merge changes I90bf7957,If58524b0 am: 029ba17cb0 am: c3e38ade53
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1646972

Change-Id: I13d23ef04c694527a4440f6bed21699684ec7424
2021-03-22 11:01:50 +00:00
Lorenzo Colitti
2c5b333737 [automerger skipped] Merge "Copy NetworkNotificationManager resources to conectivity module." am: 4385ef6896 am: cc018f77ec am: db1ad4da2b -s ours
am skip reason: skip tag Change-Id I99c0d28069dd1a13d452105b0a83a03a833232a2 with SHA-1 3b8af467a8 is already in history

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

Change-Id: I97d82338363702be56963839a241e1d72c1e9c86
2021-03-22 11:00:35 +00:00
Remi NGUYEN VAN
52950eda63 Remove ConnectivityService hidden annotations
BoolRes and VpnType are hidden annotations that should not be used in a
module class.

Test: m
Bug: 171540887
Change-Id: I84690c868ecc62a546ec97bcae2e017a283dc07e
2021-03-22 10:44:40 +00:00
Remi NGUYEN VAN
fff9cd3b1c Remove hidden Icon.createWithResource API usage
Icon.createWithResource(Context, int) is public, but
Icon.createWithResource(Resources, int) is a hidden API.

Replace the former by the latter in NetworkNotificationManager, so that
it builds against stable APIs.

Bug: 182125649
Test: atest FrameworksNetTests
Change-Id: Ied29d3c7fb517d0c82f40662a1e0e87186c3a89e
2021-03-22 10:34:24 +00:00
Lorenzo Colitti
c3e38ade53 Merge changes I90bf7957,If58524b0 am: 029ba17cb0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1646972

Change-Id: I1c3de9d738a294e9d21314de84384fa89745285d
2021-03-22 10:17:37 +00:00
Lorenzo Colitti
029ba17cb0 Merge changes I90bf7957,If58524b0
* changes:
  Fix privileged apps calling registerDefaultNetworkCallback.
  Test a bug with NETWORK_SETTINGS+registerDefaultNetworkCallback.
2021-03-22 09:43:53 +00:00
Lucas Lin
def33143e8 Merge "Remove the usage of NETID_UNSET from Vpn.java" into sc-dev 2021-03-22 09:38:26 +00:00