Commit Graph

13045 Commits

Author SHA1 Message Date
Chiachang Wang
b948cc3ba0 Merge "Correct the logic in NetworkCapabilitiesTest" am: 2848cdf348 am: 06238861b5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1649297

Change-Id: I224e3c120ac07677d80396247f5b9e74c1bfd1a4
2021-03-23 12:10:57 +00:00
Chiachang Wang
5898f562ed Merge "Add NetworkRequest.Builder creating from an existing instance" am: 08bebe4609 am: eefea38ae5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1649294

Change-Id: I96516eb0d976d6e6250d2e96c316c560bfa21ab5
2021-03-23 12:09:42 +00:00
Chiachang Wang
06238861b5 Merge "Correct the logic in NetworkCapabilitiesTest" am: 2848cdf348
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1649297

Change-Id: I32bc9ee2db0b192513f782455a91d7336875a039
2021-03-23 12:07:47 +00:00
Chiachang Wang
2848cdf348 Merge "Correct the logic in NetworkCapabilitiesTest" 2021-03-23 11:46:31 +00:00
Chiachang Wang
eefea38ae5 Merge "Add NetworkRequest.Builder creating from an existing instance" am: 08bebe4609
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1649294

Change-Id: Ib990cb25d50c11b103e248c0c13c584e78aa3450
2021-03-23 11:36:07 +00:00
Chiachang Wang
08bebe4609 Merge "Add NetworkRequest.Builder creating from an existing instance" 2021-03-23 10:46:20 +00:00
junyulai
1ed0b04410 Fix cannot find removeUnwantedCapability on R device
Test: atest CtsNetTestCasesLatestSdk:android.net.NetworkCapabilitiesTest
Fix: 183473863
Merged-In: Icf2cda325795acee22a6c634e8d978f64c5ac3cb
Change-Id: Icf2cda325795acee22a6c634e8d978f64c5ac3cb
  (cherry-picked from ag/13966708)
2021-03-23 17:40:55 +08:00
Remi NGUYEN VAN
2c5c322eb9 Use a longer test timeout in integration test
One second to start the test NetworkStack service and obtain
a NetworkMonitor is too tight.

Change-Id: I3ac600276b6248c70c6239b0c9531913dc44096e
Test: atest ConnectivityServiceIntegrationTest
2021-03-23 09:33:16 +00:00
Chiachang Wang
29d00bc32d Correct the logic in NetworkCapabilitiesTest
setOwnerUid() and setAdministratorUids() should run in R+.
Previous logic will skip them in S+. Correct the logic to
what it should be.

Bug: 172183305
Test: atest android.net.NetworkCapabilitiesTest
Change-Id: Ic983aa00f930fb26350469ef093bcba2990433a4
2021-03-23 15:16:39 +08:00
Chiachang Wang
992047ed78 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
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
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
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
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
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
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
3949d6ed96 Expose registerDefaultNetworkCallbackAsUid.
Bug: 165835257
Test: atest FrameworksNetTests
Change-Id: I638ed5cd5273d456919630aba1e22f099df1b36c
2021-03-22 19:50:27 +09: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
Lorenzo Colitti
b199b960c7 Support calling registerDefaultNetworkCallback for another UID.
This is to be used by privileged components (e.g., JobScheduler)
to request callbacks about the state of other UIDs on the system.

Bug: 165835257
Test: new unit test coverage
Change-Id: I29f155710394e58c14fcef488db6271d8d83033a
2021-03-22 17:52:20 +09:00
junyulai
767c9f26de [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
Chiachang Wang
7007e04119 [automerger skipped] Merge "Revert "Correct the logic in NetworkCapabilitiesTest"" am: 3f603fae13 -s ours am: 60450deb67
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1645005

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

Change-Id: I553b1c59e6a35c8e8a0ac7dc59d2367bffa1f39d
2021-03-22 07:37:02 +00:00
Chiachang Wang
60450deb67 [automerger skipped] Merge "Revert "Correct the logic in NetworkCapabilitiesTest"" am: 3f603fae13 -s ours
am skip reason: skipped by user chiachangwang

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

Change-Id: Ib56fafd17dc88b9ded6cd39501a3bfa4cf5fe1b5
2021-03-22 07:17:25 +00:00
Treehugger Robot
8297bc95a0 [automerger skipped] Merge "Correct the logic in NetworkCapabilitiesTest" am: 58f4cdf3b3 -s ours
am skip reason: skipped by user chiachangwang

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

Change-Id: Ib61e9100ff497a22a900aa13a83027242ddddecb
2021-03-22 06:55:09 +00:00
Chiachang Wang
3f603fae13 Merge "Revert "Correct the logic in NetworkCapabilitiesTest"" 2021-03-22 06:26:33 +00:00
Chiachang Wang
f2b0b41764 Revert "Correct the logic in NetworkCapabilitiesTest"
This reverts commit 628ada1d2d.

Reason for revert: <Merge abnormal in automerger>

Change-Id: I0cdb401f4962050bf24dc9d9871d4ef15cf52629
2021-03-22 06:15:02 +00:00
Lorenzo Colitti
f2514125b6 Store the effective UID in NetworkRequestInfo.
This is necessary for privileged components such as
JobScheduler to file NetworkCallbacks on behalf of other
UIDs.

This CL adds the field to NetworkRequestInfo and updates some
of the matching code, but does not set the field to anything
other than the UID that created the request. Thus, it should
cause no behaviour changes.

Bug: 165835257
Test: refactoring with no change in behaviour, passes existing tests
Change-Id: I21a22ed1b851b8511d36f5202c9eac03e7158d3d
2021-03-22 14:52:38 +09:00
Remi NGUYEN VAN
8b4738d3b3 Merge "Remove Preconditions usage in TestNetworkSpecifier" am: afdb6a7347 am: 6a4a9423ef
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1644991

Change-Id: Id66ea1eda381be3b42a3ccf553d831d49b5fb7b7
2021-03-22 04:01:28 +00:00
Remi NGUYEN VAN
e6fb8c44dd Merge "Revert "Revert "Remove connectivity dependency on Preconditions""" am: aa1d743312 am: 5024171a1f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1635319

Change-Id: Id6fa989fa1d24261d29ab61d0a666cc6a33dc7b8
2021-03-22 04:01:01 +00:00
Remi NGUYEN VAN
0847f57ff9 Merge "Add TEST_MAPPING for Connectivity" am: b2fe416e82 am: 1a7066d0a5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1646851

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

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

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

Change-Id: I2bf2b8a3eccf7dab7ac22efd9a444dbaa67faa79
2021-03-22 03:58:17 +00:00
Roshan Pius
c8ed8dce59 resolve merge conflicts of d2c4f1d6c8 to stage-aosp-master am: 39ff19da2f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13944446

Change-Id: Ia4f30adab268c9c51d89d61355a48da00b855190
2021-03-22 03:55:23 +00:00
Remi NGUYEN VAN
6a4a9423ef Merge "Remove Preconditions usage in TestNetworkSpecifier" am: afdb6a7347
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1644991

Change-Id: Ifca29ba189f58655b0229467e2d86b0b6426b2d1
2021-03-22 03:32:31 +00:00
Remi NGUYEN VAN
5024171a1f Merge "Revert "Revert "Remove connectivity dependency on Preconditions""" am: aa1d743312
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1635319

Change-Id: I0a933c31e05428526a5c6fb4ef694f7c4cf818bb
2021-03-22 03:29:41 +00:00
Remi NGUYEN VAN
1a7066d0a5 Merge "Add TEST_MAPPING for Connectivity" am: b2fe416e82
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1646851

Change-Id: I829c839620849e3a49be0f2629157f4adb9a1dcb
2021-03-22 03:26:46 +00:00
Treehugger Robot
dea1480c0b Merge "Move trimV4AddrZeros to libs/net" am: 33b1df7ec4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1636022

Change-Id: Ifbad5630a39f8990479a5f20e018a3a499334fe1
2021-03-22 03:23:48 +00:00