Commit Graph

13012 Commits

Author SHA1 Message Date
lucaslin
c76b482ada Expose NetworkScore to external caller am: 026a987e1e am: e1f3a8b1da
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1653938

Change-Id: I807cae8d95e8d5fb1f017b1ba11d800772ba3e9c
2021-03-25 12:22:59 +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
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
Treehugger Robot
fcf54cf966 Merge "Use a longer test timeout in integration test" am: f652408e6c am: 7ffa156a73
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1650287

Change-Id: Iac1fdb3d92501b292ecbff1f9a75bcecbcb23725
2021-03-25 02:36:19 +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
3bad6f9856 Merge "Add 5G/NR QOS support" am: df448f6eaa am: 6ed7c1c523
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1643762

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

Change-Id: I99fe564e3fd7e6e92416a3d76054e62969cdd48f
2021-03-24 18:53:30 +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
b5d62d1f83 Merge "Fix cannot find removeUnwantedCapability on R device" am: 3ef6584f1b am: f85195ae06
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1649302

Change-Id: Ia574c52344290f5baf5fbee90ed1f6f7c7e0f92c
2021-03-23 13:29:15 +00: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
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