Commit Graph

12676 Commits

Author SHA1 Message Date
Lucas Lin
22f8ded94a Merge "Remove the usage of NETID_UNSET from Vpn.java" am: 0f114dff28
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1653929

Change-Id: Ic50dee391e123b9e9debb8e77bac1f0499d939f1
2021-03-25 12:25:42 +00:00
Lucas Lin
cc2827494a Merge "Expose some APIs from ConnectivityManager" am: bcf2a79ec8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1653936

Change-Id: I1a31a6162d5098770c0d5b19faa7af83553f6a2e
2021-03-25 12:17:18 +00:00
Lucas Lin
6cece1f221 Merge changes Ic2357dcf,Iddf8c71a am: 29ed3efbfe
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1653939

Change-Id: I9c5f96893488f1e103cba740a0bbfb474ffe90b9
2021-03-25 12:07:49 +00:00
lucaslin
e1f3a8b1da Expose NetworkScore to external caller am: 026a987e1e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1653938

Change-Id: I5f2fb6bb6f2de4d81fb3b750053ee5abbe82caeb
2021-03-25 11:53:29 +00:00
Lucas Lin
0f114dff28 Merge "Remove the usage of NETID_UNSET from Vpn.java" 2021-03-25 11:29:17 +00:00
Lucas Lin
bcf2a79ec8 Merge "Expose some APIs from ConnectivityManager" 2021-03-25 11:29:08 +00:00
Lucas Lin
29ed3efbfe Merge changes Ic2357dcf,Iddf8c71a
* changes:
  Expose NetworkAgent constructor taking a NetworkScore parameter
  Expose NetworkScore to external caller
2021-03-25 11:28:28 +00:00
lucaslin
6b49587384 Remove the usage of NETID_UNSET from Vpn.java
Modify Vpn#getNetId() to Vpn#getNetwork() and uses NETID_UNSET
when getNetwork() returns null in ConnectivityServiceTest.

Bug: 182963397
Test: atest FrameworksNetTests
Change-Id: I69d449705b1dc541287c72af8dc7705dc4733109
Merged-In: I69d449705b1dc541287c72af8dc7705dc4733109
  (cherry-picked from ag/13927650)
2021-03-25 10:19:05 +00:00
Chiachang Wang
823542095f 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
Merged-In: Ic2357dcfff3233e0dd17b48b0e376a5095ef60fa
CTS-Coverage-Bug: 172183305
  (cherry-picked from ag/13966707)
2021-03-25 08:40:27 +00:00
lucaslin
026a987e1e 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
Merged-In: Iddf8c71a5f51a40bc6ff78626b3e8ee530d1b7eb
  (cherry-picked from ag/13947595)
2021-03-25 08:15:09 +00:00
lucaslin
2e68aa2e7a 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
Merged-In: I1fb5ecfbe37878ba3534e6c6c7599ca29db2735c
  (cherry-picked from ag/13927657)
2021-03-25 08:07:53 +00:00
Treehugger Robot
7ffa156a73 Merge "Use a longer test timeout in integration test" am: f652408e6c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1650287

Change-Id: Ia76f196039f7d748f47bd4e9a62eb59c8ad1b116
2021-03-25 01:53:51 +00:00
Treehugger Robot
f652408e6c Merge "Use a longer test timeout in integration test" 2021-03-25 01:24:51 +00:00
Jayachandran Chinnakkannu
6ed7c1c523 Merge "Add 5G/NR QOS support" am: df448f6eaa
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1643762

Change-Id: Icd4c21b9731256c9b3d39bffc5fddc43276c5fda
2021-03-24 18:26:19 +00:00
Treehugger Robot
c97c779c98 Merge "Move BLOCKED_REASON_* constants from NPMS into ConnectivityManager." am: eb3ba19447
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1651532

Change-Id: If272068940e9a06efbb40149e2b4dd5fbb1185d6
2021-03-24 18:13:19 +00:00
Jayachandran Chinnakkannu
df448f6eaa Merge "Add 5G/NR QOS support" 2021-03-24 17:44:48 +00:00
Treehugger Robot
eb3ba19447 Merge "Move BLOCKED_REASON_* constants from NPMS into ConnectivityManager." 2021-03-24 17:22:50 +00:00
Sudheer Shanka
04aab0f60f 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
Merged-In: I4c544415e12adf442fd2415c371b1b70a39c3aa4
Change-Id: I6dcea43fbefa9eac8b5a971b822a5be5422a54b4
2021-03-25 01:33:26 +09:00
Jayachandran C
8ae3bf3f92 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
Junyu Lai
f85195ae06 Merge "Fix cannot find removeUnwantedCapability on R device" am: 3ef6584f1b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1649302

Change-Id: I11ee0a8d6388f78a9db90756c0cbee93c923e1b8
2021-03-23 12:46:45 +00:00
Junyu Lai
3ef6584f1b Merge "Fix cannot find removeUnwantedCapability on R device" 2021-03-23 12:16:18 +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
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
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
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
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
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
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
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