Commit Graph

2762 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
8ae54f7a3e Remove NetdService, NetworkStackClient dependency
Netd should be obtained via getSystemService, and
ModuleNetworkStackClient must be used instead of NetworkStackClient for
modules.

Original change (project moved):
Ibe703ac56dd70673115cd8b95b44b856a7fc01f3

Bug: 171540887
Test: m
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Change-Id: I6c8593712c0e86da139d425ef6240c5004e392e2
2021-06-01 18:41:33 +09:00
TreeHugger Robot
585c1b72d8 Merge changes I81bf8969,I2edba513,Ibb913979 into sc-dev am: 98c351f429
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14452540

Change-Id: I92bceef971050f9afc1fea0e1f3a3e6f4391db5f
2021-06-01 08:06:28 +00:00
TreeHugger Robot
98c351f429 Merge changes I81bf8969,I2edba513,Ibb913979 into sc-dev
* changes:
  Add CTS for NetworkScore.setTransportPrimary
  Add some CTS tests for NetworkScore.
  Add a first CTS for NetworkScore
2021-06-01 07:41:17 +00:00
Chiachang Wang
6391e22faf Add test for ConnectivityManager.factoryReset
Bug: 186061922
Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest
Test: atest CtsNetTestCasesLatestSdk on R and S device
Change-Id: I5d3e448ed00b9baeb64a08036ecac1f9c8206cc7
2021-06-01 15:09:06 +08:00
Chiachang Wang
4f5c4c4323 Correct the logic for CtsTetheringUtils.isWifiTetheringSupported
The existing isWifiTetheringSupported only check if tethering side
supports wifi tethering or not but not wifi side. A expected
behavior should include both of them, so add the wifi side check
into the helper function. Also update in the existing caller side
due to a new parameter added.

Bug: 186061922
Test: atest MtsTetheringTestLatestSdk
Change-Id: Id69ac1d30ab2bbf23e870193335b139f54672636
2021-06-01 15:08:48 +08:00
markchien
3a23d2e2a6 Test tethered callback with TetheringInterface
The old callback only report interface list, new callback could provide
the mapping of interface and type. Replace old callback usage in cts
with new callback and check whether old callback could get the correct
interface list by comparing the result between old and new callback.

Bug: 162920185
Bug: 152203943
Test: atest CtsTetheringTest on S
      atest CtsTetheringTestLatestSdk on R
      atest MtsTetheringTestLatestSdk on S and R
Merged-In: I2a0b8c43fb340c3eaed7f0f90464199222a24280
Change-Id: I2a0b8c43fb340c3eaed7f0f90464199222a24280
2021-06-01 14:36:09 +08:00
Chalard Jean
ee93b3d3b3 Add CTS for NetworkScore.setTransportPrimary
Ignore-AOSP-First: NetworkScore incomplete in AOSP
Bug: 184037351
Test: this
Change-Id: I81bf8969ace3cb6826b30c5bbd0b896c64c73c57
2021-06-01 02:20:57 +00:00
Chalard Jean
2d2ecc3cfb Add some CTS tests for NetworkScore.
Ignore-AOSP-First: NetworkScore incomplete in AOSP
Bug: 184037351
Test: this
Change-Id: I2edba51351cd4c71727663aa85b1d5141bff2a15
2021-06-01 02:20:54 +00:00
Chalard Jean
aac204b202 Add a first CTS for NetworkScore
In an effort to make reviewing easier, this implements most of
the infra but only a mostly trivial test.

Ignore-AOSP-First: NetworkScore incomplete in AOSP
Bug: 184037351
Test: this
Change-Id: Ibb9139798ce44d748e87bae79a1e23311ec8d9b6
2021-06-01 02:20:26 +00:00
Chiachang Wang
1084882539 Merge "Unify the verification for unregister a NetworkAgent" into sc-dev 2021-06-01 02:09:37 +00:00
Christopher Lane
b0b818e7a0 resolved conflicts for merge of 381ac080 to master am: bbf3eb56b6
Original change: undetermined

Change-Id: I4330e5c8cd36475a83d94068649867aef543f3c5
2021-05-31 14:01:00 +00:00
paulhu
91e7806938 Update allowed on restricted networks getter/setter
As API review feedback, setting allowed on restricted networks
should be by uid instead of package name for security reason.
Thus, update the getter/setter to return/accept set of uids.

Bug: 188085693
Test: atest FrameworksNetTests
Merged-In: I979bf98075e6c9c0ed7e891582843fddb62643cb

Change-Id: I979bf98075e6c9c0ed7e891582843fddb62643cb
2021-05-27 16:24:50 +08:00
Remi NGUYEN VAN
418bf1436e Merge "Add owners block for migration" am: 2b579353e3 am: 190b1fdf4e
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1720350

Change-Id: Idbeb82f27d5217c28eac6835e381677649b6a5f6
2021-05-27 04:47:22 +00:00
Remi NGUYEN VAN
2b579353e3 Merge "Add owners block for migration" 2021-05-27 03:38:59 +00:00
Remi NGUYEN VAN
5e92ffe497 Merge "Set the SDK version to 29 for networking native tests included in MTS" am: b69f2c0622 am: 158c0590a9
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1711428

Change-Id: I711260aaa7d4fae57b90bcfc376bdbb89b6279ba
2021-05-27 03:05:53 +00:00
Remi NGUYEN VAN
b69f2c0622 Merge "Set the SDK version to 29 for networking native tests included in MTS" 2021-05-27 02:19:34 +00:00
Remi NGUYEN VAN
89bd526eba Add owners block for migration
The migration will merge history in downstream branches,
so changes should not be submitted in the meantime.

Bug: 189375701
Change-Id: I32d4c6a2d7344b1baf92eeac27b3cbbecd549c2d
Test: TH
2021-05-27 01:13:44 +00:00
Lorenzo Colitti
de28140262 Merge "Update allowed on restricted networks getter/setter" into sc-dev am: 962e174260
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14730611

Change-Id: I11638eb0d14d697ff702a6af08d13169fb1c7d4b
2021-05-26 12:38:13 +00:00
paulhu
68aacb407a Update allowed on restricted networks getter/setter
As API review feedback, setting allowed on restricted networks
should be by uid instead of package name for security reason.
Thus, update the getter/setter to return/accept set of uids.

Bug: 188085693
Test: atest FrameworksNetTests
Ignore-AOSP-First: Needs cherry-picks
Change-Id: I979bf98075e6c9c0ed7e891582843fddb62643cb
2021-05-26 16:16:57 +08:00
Cody Kesting
7474f67454 Require location permission for ConnDiags WiFi only.
This CL updates ConnectivityDiagnostics permission checks in
ConnectivityService to only require location permission for Networks
that have TRANSPORT_WIFI. This change is consistent with the location
restrictions required for the transports themselves. Previously,
location permissions were required for all Network types.

Bug: 187310575
Test: atest ConnectivityServiceTest ConnectivityDiagnosticsManagerTest
Change-Id: I48806533e4e705d2d9be45f3b3d3931d9294b167
2021-05-25 13:43:48 -07:00
Chiachang Wang
ecd0886e36 Unify the verification for unregister a NetworkAgent
It's a follow up of aosp/1652210.

The tests may verify partial NetworkAgent callback behavior.
The existing expectCallback will always expect to see the first
callback in the callback queue, so if tests did not verify all
the happened callback. It cannot verify the callback after
unregister. Add eventuallyExpect to wait for a target callback
and skip the disinterest ones, and verify the unregister
behavior for NetworkAgent callback in one method.

Bug: 178725261
Test: atest android.net.cts.NetworkAgentTest
Change-Id: I66d8e5a0fa1e2245711e8ac90d9daca24802e399
Merged-In: I66d8e5a0fa1e2245711e8ac90d9daca24802e399
(cherry picked from commit 12a6422f47)
2021-05-25 01:03:13 +00:00
Luke Huang
b243be34f7 Set the SDK version to 29 for networking native tests included in MTS
Here comes a new relocations scheme that isn't compatible with Q
devices after aosp/1673945.
In order to avoid our tests are built with the new scheme, set SDK
version to 29.

Bug: 187905499
Test: forrest, atest
Change-Id: I31f13e2b95bacdca4c1897742cada2da169a89fd
2021-05-24 19:33:48 +00:00
Baligh Uddin
087dd90e5b Merge history of packages/Connectivity am: 2afd0986d3
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14700782

BUG: 186628461
Merged-In: Ie82d0fb34bda77543e31c82660c6f315efa87f62
Change-Id: Ia7945b929573c9a5e697fb69358cd6d3c8beab00
2021-05-24 08:21:53 +00:00
Baligh Uddin
3684713b8a Merge history of packages/Connectivity
Modified License Import for:
- Tethering/common/TetheringLib/Android.bp
- framework/Android.bp
- service/Android.bp
- tests/common/Android.bp
- tests/deflake/Android.bp
- tests/integration/Android.bp
- tests/smoketest/Android.bp
- tests/unit/Android.bp
- tests/unit/jni/Android.bp

BUG: 186628461
TEST: TH
Merged-In: I7b5fd61cd551c7010f5b8ceabbfdd04f30f648dd
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Change-Id: Ia2185820f485e8ad2d3626a96eab7f5a874736cf
2021-05-24 05:45:18 +00:00
Baligh Uddin
2afd0986d3 Merge history of packages/Connectivity
Modified Visibility / Includes for:
- Tethering/common/TetheringLib/Android.bp

Modified License Import for:
- framework/Android.bp
- service/Android.bp
- tests/common/Android.bp
- tests/deflake/Android.bp
- tests/integration/Android.bp
- tests/smoketest/Android.bp
- tests/unit/Android.bp
- tests/unit/jni/Android.bp
Modified Lint mapping for:
- framework/lint-baseline.xml
- service/lint-baseline.xml

BUG: 186628461
TEST: TH
Merged-In: Ie82d0fb34bda77543e31c82660c6f315efa87f62
Change-Id: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
2021-05-24 04:40:14 +00:00
TreeHugger Robot
958fe9a51d Merge changes I1de322c9,Id0983d4b into sc-dev
* changes:
  Improve IKEv2/IPsec VPN by proposing more IPsec algorithms
  Improve IKEv2/IPsec VPN by proposing more IKE algorithms
2021-05-22 05:05:51 +00:00
TreeHugger Robot
424e2ef3aa Merge "Check location permission for ConnDiags last." into sc-dev 2021-05-22 05:01:18 +00:00
Yan Yan
f1ea9b302c Improve IKEv2/IPsec VPN by proposing more IPsec algorithms
This commit allows IKEv2/IPsec VPN to propose more algorithms that
newly added in IpSecAlgorithm. Those new algorithms have stronger
security guarantees and better performances.

This commit also removes algorithm name validation because all
algorithms are URL encoded to ensure no special characters create
problems due to their use by VpnProfile for list or field delimiting
(e.g. rfc7539esp(chacha20,poly1305))

Bug: 185265778
Test: atest FrameworksNetTests, CtsNetTestCases
Test: All new algorithms are manually verified
Change-Id: I1de322c95aacc8924e95bcdbcfdbd1ec441de99c
Merged-In: I1de322c95aacc8924e95bcdbcfdbd1ec441de99c
2021-05-21 23:33:23 +00:00
Yan Yan
5cb9e37a55 Merge "Improve IKEv2/IPsec VPN by proposing more IPsec algorithms" 2021-05-21 22:00:30 +00:00
Yan Yan
f3cf55f793 Improve IKEv2/IPsec VPN by proposing more IPsec algorithms
This commit allows IKEv2/IPsec VPN to propose more algorithms that
newly added in IpSecAlgorithm. Those new algorithms have stronger
security guarantees and better performances.

This commit also removes algorithm name validation because all
algorithms are URL encoded to ensure no special characters create
problems due to their use by VpnProfile for list or field delimiting
(e.g. rfc7539esp(chacha20,poly1305))

Bug: 185265778
Test: atest FrameworksNetTests, CtsNetTestCases
Test: All new algorithms are manually verified
Change-Id: I1de322c95aacc8924e95bcdbcfdbd1ec441de99c
2021-05-21 17:46:54 +00:00
Mark Chien
6189804a78 Merge "Test tethered callback with TetheringInterface" into sc-dev am: fcda6f1131
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14622456

Change-Id: Ieaf91ca0b5ebff475a24a21ac0b483591f81207e
2021-05-21 16:24:28 +00:00
Cody Kesting
0b4be0203d Check location permission for ConnDiags last.
This CL updates ConnectivityService to check location permissions for
ConnectivityDiagnostics callbacks last in the permission check process.
This minimizes misattribution of location access for networks that an
app is not administering.

This CL also updates ConnectivityDiagnosticsManager documentation to
clearly state that location permissions are required in order to receive
callbacks.

Bug: 187310575
Test: atest ConnectivityDiagnosticsManagerTest
Test: atest ConnectivityServiceTest
Change-Id: I2dbeddac6273e2392ccaeae51a1c7776d6d3da75
Merged-In: I2dbeddac6273e2392ccaeae51a1c7776d6d3da75
(cherry picked from commit f3d0fc49db)
2021-05-21 16:22:50 +00:00
Mark Chien
fcda6f1131 Merge "Test tethered callback with TetheringInterface" into sc-dev 2021-05-21 16:04:47 +00:00
Junyu Lai
cdfe0911c1 Merge "Add CTS for getAllNetworkStateSnapshots" into sc-dev am: 9a4c06f276
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14598438

Change-Id: Ica5635e919edc09bcd208226a0551749dd369ef5
2021-05-21 09:51:22 +00:00
Junyu Lai
9a4c06f276 Merge "Add CTS for getAllNetworkStateSnapshots" into sc-dev 2021-05-21 09:36:49 +00:00
Chiachang Wang
158fae71b4 Merge "Unify the verification for unregister a NetworkAgent" am: 14e14a36ea am: 65fd62fc63
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1664603

Change-Id: I8559fb107b6b70a34dc3d088e212fe85546af433
2021-05-21 08:20:57 +00:00
Chiachang Wang
0aa413eba7 Add test for NetworkCapabilities.Builder.withoutDefaultCapabilities
Bug: 186061922
Test: atest CtsNetTestCases:android.net.NetworkCapabilitiesTest
Merged-In: I369e71dd6ae85da78e114ea8377967ab0bde787b
Change-Id: I369e71dd6ae85da78e114ea8377967ab0bde787b
(cherry picked from commit 0aa0790dec)
2021-05-21 07:54:46 +00:00
Chiachang Wang
14e14a36ea Merge "Unify the verification for unregister a NetworkAgent" 2021-05-21 07:47:58 +00:00
junyulai
3a64e80dee Add CTS for getAllNetworkStateSnapshots
Ignore-AOSP-First: Needs cherry-picks
Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest#testGetAllNetworkStateSnapshots --rerun-until-failure 100
Test: atest
CtsNetTestCasesLatestSdk:android.net.cts.ConnectivityManagerTest on R
device
Bug: 188140631

Change-Id: I573b009bd05bbc0c855aaa6e20cb8ebde6729936
2021-05-21 06:43:31 +00:00
Chiachang Wang
32bd81d88b Merge "Add test for NetworkCapabilities.Builder.withoutDefaultCapabilities" 2021-05-21 03:33:23 +00:00
Chiachang Wang
92346fdf33 Add test for NetworkCapabilities.Builder.withoutDefaultCapabilities
Bug: 186061922
Test: atest CtsNetTestCases:android.net.NetworkCapabilitiesTest
Change-Id: I369e71dd6ae85da78e114ea8377967ab0bde787b
2021-05-21 09:57:42 +08:00
Cody Kesting
c5f9939bf3 Merge "Check location permission for ConnDiags last." 2021-05-20 21:27:46 +00:00
TreeHugger Robot
f9d1bbb566 Merge "Add more unit tests for ConnectivityManager S APIs" into sc-dev 2021-05-20 16:32:19 +00:00
markchien
82f99f95b7 Test tethered callback with TetheringInterface
The old callback only report interface list, new callback could provide
the mapping of interface and type. Replace old callback usage in cts
with new callback and check whether old callback could get the correct
interface list by comparing the result between old and new callback.

Bug: 162920185
Bug: 152203943
Test: atest CtsTetheringTest on S
      atest CtsTetheringTestLatestSdk on R
      atest MtsTetheringTestLatestSdk on S and R
Ignore-AOSP-First: Its dependences CL is not in aosp currently.

Change-Id: I2a0b8c43fb340c3eaed7f0f90464199222a24280
2021-05-20 09:02:39 +00:00
Les Lee
627c446560 Merge "Support to query TYPE_WIFI usage with subscriberId" into sc-dev 2021-05-20 08:55:59 +00:00
Paul Hu
5acfe4933e Merge "Register APPS_ALLOWED_ON_RESTRICTED_NETWORKS setting observer" into sc-dev 2021-05-20 08:45:35 +00:00
Junyu Lai
056b6649cd Add CTS for NetworkAgentConfig#setSubscriberId
Ignore-AOSP-First: Needs cherry-picks
Test: atest CtsNetTestCases:android.net.cts.NetworkAgentTest
Test: atest CtsNetTestCasesLatestSdk:android.net.cts.NetworkAgentTest
      on R device
Bug: 188140631
Change-Id: I90d47ac9bd0570c0aed19402fa9be4e99e0f8621
2021-05-20 06:07:08 +00:00
Paul Hu
740da160bc Merge "Read APPS_ALLOWED_ON_RESTRICTED_NETWORKS setting from PermissionMonitor" into sc-dev 2021-05-20 05:57:25 +00:00
Junyu Lai
ffda3053d1 Add more unit tests for ConnectivityManager S APIs
Ignore-AOSP-First: Avoid merge conflict
Test: atest android.net.ConnectivityManagerTest
Bug: 188657173
Change-Id: I33612650eb89486a14fcfc440ba0c357f4bb513c
2021-05-19 15:34:38 +00:00
Les Lee
8a2405cb6d Merge "Add metered filter for API: buildTemplateCarrier" into sc-dev 2021-05-19 14:32:29 +00:00