Commit Graph

23270 Commits

Author SHA1 Message Date
Chiachang Wang
02eea987c0 Merge changes I5d3e448e,Id69ac1d3
* changes:
  Add test for ConnectivityManager.factoryReset
  Correct the logic for CtsTetheringUtils.isWifiTetheringSupported
2021-06-02 01:24:10 +00:00
Treehugger Robot
c4d26414f8 Merge "Test tethered callback with TetheringInterface" 2021-06-01 14:35:48 +00:00
Treehugger Robot
414edc4ac9 Merge "Add the tethering type to TetheringEventCallback methods" 2021-06-01 14:33:51 +00:00
Aaron Huang
87f051bfa6 Merge "Add required permission to Tethering" 2021-06-01 10:13:34 +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
markchien
35ad54b25e Add the tethering type to TetheringEventCallback methods
Before this change, tethering always report a list of tethered
interfaces and the caller need to use each tethering type's interface
regex to matching tethered list to manual implement the mapping of
tethering type and interface. This change allow caller to get rid of
tethering interface regex.

Bug: 162920185
Bug: 152203943
Test: atest CtsTetheringTest on S

Merged-In: I91bcccd676d109c1b974497ac29bd366a41b8899
Change-Id: I91bcccd676d109c1b974497ac29bd366a41b8899
2021-06-01 14:35:39 +08:00
Remi NGUYEN VAN
43740568b6 Merge "Revert "Add owners block for migration"" 2021-06-01 00:05:06 +00:00
Remi NGUYEN VAN
b22e9ad95d Revert "Add owners block for migration"
The migration is now done.
Modification in revert: kept tests/OWNERS deleted.

Bug: 189375701
Change-Id: Ie105882fc61f7395f2e37711d4849c63e1f7199d
2021-05-31 10:34:04 +00:00
Remi NGUYEN VAN
b2f2271ef1 Merge fixed history of Connectivity
BUG: 189375701
TEST: TH
Merged-In: I37e52cf7d59b6dbcd77879725385c7940318b835
Merged-In: Ie3a058b904cb2e3704c3a0725c8f720f81bb235e
Change-Id: I5e5190b50aee85cc238d927f6499cee2e61f5d60
2021-05-31 03:44:47 +00:00
Anton Hansson
f827199767 Merge "Include sdk versioning proto in tethering apex" 2021-05-27 10:05:22 +00:00
Anton Hansson
db3b06959f Include sdk versioning proto in tethering apex
Allows SdkExtensions to inspect its version to decide what the extension
sdk version is on-device.

Bug: 188787081
Test: m com.android.tethering and inspect
Merged-In: If2d28b02be871594fed1fbb40b7aad284b553afb
Change-Id: If2d28b02be871594fed1fbb40b7aad284b553afb
2021-05-27 07:35:31 +00:00
Remi NGUYEN VAN
2b579353e3 Merge "Add owners block for migration" 2021-05-27 03:38:59 +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
Aaron Huang
3f69f1c418 Add required permission to Tethering
The permission of Tethering is moved to a separate xml file,
add the xml module to the required field of tethering app.

Bug: 151213404
Test: TetheringTests
Merged-In: I40b45a0f1b44fba0b68e94811d14725a59ed4e59
Change-Id: I40b45a0f1b44fba0b68e94811d14725a59ed4e59
2021-05-26 23:29:55 +08:00
Nikita Ioffe
d2d0d82a1d Merge "Mark tethering apex as compressible" 2021-05-26 10:29:16 +00:00
Maciej Żenczykowski
fc592e8bc0 Merge "Fix memory access violation in NetworkStack" 2021-05-24 23:56:06 +00:00
Remi NGUYEN VAN
e107f26c5d Merge "Merge history of packages/Connectivity" 2021-05-24 23:32:43 +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
Ye Jiao
86f56a135a Fix memory access violation in NetworkStack
Fix memory access violation in com_android_networkstack_tethering_BpfUtils.cpp
caused by invalid format string in com_android_networkstack_tethering_BpfUtils_isEthernet.
If rv is not valid, jniThrowException will format a string using
"Unknown hardware address type %s on interface %s". However, rv is an int but here
"%s" is used in fmt string, thus causing access violation of memory.

Use "%d" instead of "%s" for int.

Bug: 188757793
Change-Id: I9d8ec0708efd747e24b3b3ffed5336434d4f64a7
2021-05-24 06:12:56 +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
Mark Chien
011552cc54 Merge "Disable tryCell when UpstreamMonitor stop" 2021-05-24 02:27:13 +00:00
Baligh Uddin
b2e0bdedc5 Merge "Add OWNERS block for migration" 2021-05-22 04:01:33 +00:00
Baligh Uddin
3dcbcae839 Merge "Add OWNERS block for migration" 2021-05-22 04:01:33 +00:00
Yan Yan
70a118d80d Merge "Improve IKEv2/IPsec VPN by proposing more IPsec algorithms" 2021-05-21 22:00:30 +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
86783c3711 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
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
Baligh Uddin
1f79fbec56 Add OWNERS block for migration
BUG: 186628461
Test: TH
Change-Id: Id03e0dfbe621b8ad08e594c0f6525ad9240837ae
2021-05-21 16:33:32 +00:00
Baligh Uddin
0e8ea277cd Add OWNERS block for migration
BUG: 186628461
Test: TH
Change-Id: Id03e0dfbe621b8ad08e594c0f6525ad9240837ae
2021-05-21 16:33:32 +00:00
markchien
89f2670b65 Disable tryCell when UpstreamMonitor stop
tryCell configuration would not be force disabled UpstreamMonitor stop.
If tethering stop with using mobile upstream and swap with SIM fron no
dun to dun supported, dun request would be filed even tethering is not
active.

Bug: 173068192
Test: atest TetheringTests
Change-Id: I5505655f52da9fdca2fd43a58e043a9ab727741d
2021-05-21 20:35:11 +08:00
Orion Hodson
bfca37aaac Merge "Move to renamed NDK symbol AFileDescriptor_getFd" 2021-05-21 08:29:52 +00:00
Orion Hodson
544989351f Merge "Move to renamed NDK symbol AFileDescriptor_getFd" 2021-05-21 08:29:52 +00:00
Chiachang Wang
14e14a36ea Merge "Unify the verification for unregister a NetworkAgent" 2021-05-21 07:47:58 +00:00
Chiachang Wang
8789adc1cd Merge "Add test for NetworkCapabilities.Builder.withoutDefaultCapabilities" 2021-05-21 03:33:23 +00:00
Chiachang Wang
32bd81d88b Merge "Add test for NetworkCapabilities.Builder.withoutDefaultCapabilities" 2021-05-21 03:33:23 +00:00
Junyu Lai
ff77e99cf0 Merge "Fix TetheringTest crash on eng build" 2021-05-21 02:40:13 +00:00
Chiachang Wang
b162e0e0a7 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
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
Treehugger Robot
8d8404ef8f Merge "Use CS identity to update setting while performing factory reset" 2021-05-21 01:26:05 +00:00
Treehugger Robot
049dbc5697 Merge "Use CS identity to update setting while performing factory reset" 2021-05-21 01:26:05 +00:00
Cody Kesting
7f092f1f90 Merge "Check location permission for ConnDiags last." 2021-05-20 21:27:46 +00:00
Cody Kesting
c5f9939bf3 Merge "Check location permission for ConnDiags last." 2021-05-20 21:27:46 +00:00
Treehugger Robot
d9de9d783b Merge "Add bootclasspath_fragment." 2021-05-20 09:37:05 +00:00
Treehugger Robot
7960575fab Merge "Update connectivity TEST_MAPPING" 2021-05-20 08:49:46 +00:00
Chiachang Wang
fe28d9b0ad Use CS identity to update setting while performing factory reset
When apps try to call factoryReset to do networking reset, it
will result in updating the setting in SettingsProvider.
ContentProvider will verify if the package name of the caller
that initiated the request being processed on the current thread.
The package should belong to the calling UID. The setting update
started from the ConnectivityService context, so the package will
be android but the calling UID will be the calling app. It will
cause a SecurityException. The behavior is fine previously as its
known caller(Settings) shares system UID. But it will be a
problem for other callers, such as CTS. Thus, clear the identity
since the necessary permission check should be examined at the
top of the method. The following actions should be fine to be
proceed from the system itself. Also replace the user restriction
check via hasUserRestrictionForUser with the UserHandle created
from the calling uid to ensure it's verified with correct user.

Bug: 186061922
Test: Factory reset from Settings
Change-Id: If2dd69f702a1eafff331f9e71f6b92aeadfb715d
2021-05-20 10:01:50 +08:00
Chiachang Wang
bc66712394 Use CS identity to update setting while performing factory reset
When apps try to call factoryReset to do networking reset, it
will result in updating the setting in SettingsProvider.
ContentProvider will verify if the package name of the caller
that initiated the request being processed on the current thread.
The package should belong to the calling UID. The setting update
started from the ConnectivityService context, so the package will
be android but the calling UID will be the calling app. It will
cause a SecurityException. The behavior is fine previously as its
known caller(Settings) shares system UID. But it will be a
problem for other callers, such as CTS. Thus, clear the identity
since the necessary permission check should be examined at the
top of the method. The following actions should be fine to be
proceed from the system itself. Also replace the user restriction
check via hasUserRestrictionForUser with the UserHandle created
from the calling uid to ensure it's verified with correct user.

Bug: 186061922
Test: Factory reset from Settings
Change-Id: If2dd69f702a1eafff331f9e71f6b92aeadfb715d
2021-05-20 10:01:50 +08:00
Remi NGUYEN VAN
d954bfcd32 Update connectivity TEST_MAPPING
- Move Tethering TEST_MAPPING up one level to merge with the general
   Connectivity TEST_MAPPING. This allows running the tethering tests
   on any connectivity change.
 - Move TetheringIntegrationTests from postsubmit to presubmit
 - Add TetheringCoverageTests to mainline-postsubmit, so it can be
   added to mainline-presubmit later.
 - Import NetworkStack tests so that they are run on any connectivity
   change.

TetheringIntegrationTests were continuously green in postsubmit.

Bug: 187946226
Change-Id: Ibf05ad64b02c563930ba0f01eb91331b295fe505
Test: Treehugger needed to test TEST_MAPPING files
2021-05-20 01:26:51 +00:00