Commit Graph

36942 Commits

Author SHA1 Message Date
Treehugger Robot
464d0b2bdd Merge "add test for /system/etc/bpf/{netd,clatd}.o using correct struct sizes" 2021-07-06 20:44:57 +00:00
Maciej Żenczykowski
bbc4ea32bc add test for /system/etc/bpf/{netd,clatd}.o using correct struct sizes
This test is required to ensure that the system is compatible
with future updates of the tethering mainline module, which
updates BPF .o files on device.

This test must already be passing on OEM devices because otherwise
the offload.o program in the Tethering mainline module would bootloop
the device.

Bug: 190519702
Test: atest CtsNativeNetTestCases, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ibaedb8fcb28591ffba1506514f2305d55712a26b
2021-07-06 02:50:47 -07:00
Remi NGUYEN VAN
00407b0c1b Add retries for WifiManager#connect
Connect can error with BUSY if the framework is busy when connect is
called. Add retries so that if this happens, the connection can succeed
after the framework stops being busy.

Also log the level of scan results when several configurations are
available, and clarify the legacy broadcast assert.

Bug: 188077861
Test: atest CtsNetTestCases
Change-Id: I99ce72bd2604489cb419ea9984643b6985728461
2021-07-06 17:53:48 +09:00
Remi NGUYEN VAN
e687d5844e Fix flake in testMobileDataAlwaysOn
The internal structure backing getAllNetworks is updated after
invoking lost callbacks, so the test needs to wait for the handler
to be idle before calling getAllNetworks.

Also avoid assertions in finally clauses, as it causes confusing
error messages.

Bug: 185081944
Change-Id: I8ad5ab45a3e65b0031672e6f594b1a6d6ad5abcb
Test: atest ConnectivityServiceTest
2021-07-06 06:09:17 +00:00
Remi NGUYEN VAN
1f210f792a Fix flake in testConnectivityDiagnosticsCallbackOnConnectivityReported
The test relied on waitForIdle to ensure diagnostics callbacks were called,
but as this may require several iterations in the handler queue, this makes
the test unreliable.

Use mockito timeouts on the verify() calls instead.

Bug: 192651465
Change-Id: Iae1704af7ae3649eae301c6aee223ac753629d55
Test: atest ConnectivityServiceTest
2021-07-06 06:05:38 +00:00
Lorenzo Colitti
51f5f61742 Merge "Load ncm regexs config to tetherableUsbRegexs if isUsingNcm=true" am: 844ca1290e
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1755176

Change-Id: I5c7cb78792108b89b366da9528ffae424331aba9
2021-07-06 03:51:26 +00:00
Lorenzo Colitti
736df2cb2f Merge "Enable and disable usb IpServer according to ACTION_USB_STATE" am: d479e694f0
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1731453

Change-Id: Ic250214e5e731aa2505620703e53dfa2083bffa6
2021-07-06 03:51:19 +00:00
Lorenzo Colitti
844ca1290e Merge "Load ncm regexs config to tetherableUsbRegexs if isUsingNcm=true" 2021-07-06 03:39:31 +00:00
Lorenzo Colitti
d479e694f0 Merge "Enable and disable usb IpServer according to ACTION_USB_STATE" 2021-07-06 03:39:15 +00:00
Remi NGUYEN VAN
3676ffb9af Use WifiManager.connect to reconnect wifi
Address a TODO to use WifiManager#connect to reconnect wifi, instead of
WifiManager#reconnect. #connect also clears the BSSID denylist; that
list has caused flakyness due to tests that cause the network not to
validate such as captive portal or invalid private DNS behavior tests,
causing wifi to ignore the access point in reconnect attempts.

Bug: 188077861
Test: atest CtsNetTestCasesLatestSdk

Change-Id: I5a11a802db8a4881c161e6038c1c183d2ac23a05
2021-07-06 11:30:51 +09:00
markchien
b28740ec89 Load ncm regexs config to tetherableUsbRegexs if isUsingNcm=true
If config_tether_ncm_regexs is configured, load it to
tetherableUsbRegexs if ncm is used for TETHERING_USB. Load it to
tetherableNcmRegexs if ncm is used for TETHERING_NCM.

Bug: 185649441
Test: atest TetheringTests
Change-Id: I0c542560bd04e8c0a6a78d632da5a00a34d9a3fa
2021-07-05 23:11:50 +08:00
markchien
b41a00e778 Enable and disable usb IpServer according to ACTION_USB_STATE
Before this change, usb IpServer would be created if corresponding
interface is available even there is no enable tethering attempt. And
usb IpServer only be disabled when interface is removed. Usb tethering
could not be stopped if interface is always avaialbe.
After this change, usb IpServer would be enabled and disabled according
to ACTION_USB_STATE.

Bug: 185649441
Test: atest TetheringCoverageTests
      atest MtsTetheringTestLatestSdk
      atest CtsTetheringTest
Change-Id: I8375e3f998d677dc658370b2553facaec0d5ff7c
2021-07-05 22:53:07 +08:00
Junyu Lai
ce077a3ad0 Merge "Consider NetworkOffer is unneeded if it cannot satisfy the request" am: b028fc7cf1
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1731452

Change-Id: I9c7bb2e88ad6b6929bf7db3b7433b772c4f5d15a
2021-07-05 09:09:01 +00:00
Junyu Lai
b028fc7cf1 Merge "Consider NetworkOffer is unneeded if it cannot satisfy the request" 2021-07-05 08:57:07 +00:00
Remi NGUYEN VAN
b65aea1772 Merge "Move BitUtils, RingBuffer test to coretests" am: 6be4ebcb0a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1754897

Change-Id: Ib30b1f12b17241d66a80130f772d2948e3cee358
2021-07-05 05:18:21 +00:00
Remi NGUYEN VAN
6be4ebcb0a Merge "Move BitUtils, RingBuffer test to coretests" 2021-07-05 05:05:34 +00:00
Maciej Żenczykowski
f54ce8312b Merge "ipv4 tethering offload - decrement ttl during forwarding" am: f21f5357e7
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1755049

Change-Id: I5e09f466e574a8a16dc977cf18eb4922c3dbc480
2021-07-02 21:17:43 +00:00
Maciej Żenczykowski
f21f5357e7 Merge "ipv4 tethering offload - decrement ttl during forwarding" 2021-07-02 21:06:41 +00:00
Benedict Wong
4793a34212 Merge "Add tests for in-kernel VPN/VCN dataplane" am: 64619cabc1
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1749069

Change-Id: I83fd7c2c81540071bdac53f59e5b518fcc6da3e8
2021-07-02 18:58:06 +00:00
Benedict Wong
64619cabc1 Merge "Add tests for in-kernel VPN/VCN dataplane" 2021-07-02 18:42:15 +00:00
Treehugger Robot
23825be810 Merge "Listen EXTERNAL_APPLICATIONS_AVAILABLE intent" am: 321558ffe8
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1755054

Change-Id: I6611ab9e0550bd36bb941ed9136069fd19a7ab2a
2021-07-02 17:07:46 +00:00
Treehugger Robot
321558ffe8 Merge "Listen EXTERNAL_APPLICATIONS_AVAILABLE intent" 2021-07-02 16:56:12 +00:00
paulhu
8a4ce40acb Listen EXTERNAL_APPLICATIONS_AVAILABLE intent
- Some applications are installed on external storage and they
  are unavailable until exernal storage installed them
  completely. And their permission need update after becoming
  available. Thus, listen EXTERNAL_APPLICATIONS_AVAILABLE intent
  and update those package whose is listed in chaged package
  list.
- Remove user argument on buildPackageInfo() because the uid on
  ApplicationInfo is based uid.

Bug: 145234989
Test: atest FrameworksNetTests
Merged-In: Ia11ca4a7ba6fc1b87c27c0c40e36c91d9cdb322a

Change-Id: Ia11ca4a7ba6fc1b87c27c0c40e36c91d9cdb322a
2021-07-02 22:35:26 +08:00
Treehugger Robot
a1e54368ae Merge "Force only system uid can set uids allowed on restricted networks" am: 47202851ec
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1755052

Change-Id: I20ad7457e8e91b35b6ee0659b1ec1fae3f008fe8
2021-07-02 14:07:31 +00:00
Treehugger Robot
47202851ec Merge "Force only system uid can set uids allowed on restricted networks" 2021-07-02 13:52:50 +00:00
Treehugger Robot
9a7c9c3c06 Merge "Allow non-VPNs to have underlying networks." am: 5903d5646c
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1753619

Change-Id: Ie6894fc292e5d6ef7f084abcf3ddbdfdd7540648
2021-07-02 13:38:21 +00:00
Treehugger Robot
5903d5646c Merge "Allow non-VPNs to have underlying networks." 2021-07-02 13:28:01 +00:00
paulhu
92f128c51c Force only system uid can set uids allowed on restricted networks
- Check whether calling UID/PID is system_server.
- For CTS test, enforce NETWORK_SETTINGS permission otherwise if
  it's a debug build.

Bug: 175199465
Test: atest FrameworksNetTests
Test: atest ConnectivityManagerTest#testUidsAllowedOnRestrictedNetworks
Merged-In: I175a831671d3e52460d28203b09f6c0dda56b61c

Change-Id: I175a831671d3e52460d28203b09f6c0dda56b61c
2021-07-02 20:04:50 +08:00
Maciej Żenczykowski
c29af79e26 ipv4 tethering offload - decrement ttl during forwarding
Bug: 192635131
Test: atest, TreeHugger, flashed on phone, forwarded ipv4 traffic
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I88e5293a54b7867a8e7dd76f6fd8e2a52d31e51a
2021-07-02 11:33:17 +00:00
Lorenzo Colitti
bd079455f1 Allow non-VPNs to have underlying networks.
Certain network types, like the VCN, have underlying
networks for the purpose of data usage, but do not want to
propagate the underlying network capabilities.

Allow these networks to set underlying networks, but continue
not to propagate the capabilities.

Bug: 190620024
Test: new unit test
Change-Id: I53d6080f48707ff3c37fbfbef534284ba77a7432
2021-07-02 18:48:25 +09:00
Benedict Wong
1117e853f9 Add tests for in-kernel VPN/VCN dataplane
This change adds relevant tests for the migrateTun functionality in
NetworkStats.

Bug: 190620024
Test: atest NetworkStatsTest
Change-Id: I33f14f2d0f71013a594fd4c8c3914a590d30ea06
2021-07-02 00:39:32 -07:00
Remi NGUYEN VAN
a1b3f57eb8 Move BitUtils, RingBuffer test to coretests
The utilities are part of com.android.internal.util, but were
historically tested as part of the services.net tests. They were then
mistakenly moved to packages/modules/Connectivity with the rest of the
networking code, but actually belong in coretests.

Bug: 187935317
Test: atest FrameworksCoreTests
Change-Id: I74702f6a4d9bed5985d2a830dacd78129a7854a8
2021-07-02 16:24:01 +09:00
Lorenzo Colitti
da7f313fb4 Merge changes from topic "conn-diags-skipped" am: 05752a5316
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1665082

Change-Id: I8ba883ee8a92c6e6b74b555d1b89448a763af1b3
2021-07-02 06:43:22 +00:00
Cody Kesting
c6abf3d60c Report result SKIPPED in ConnDiags if the network is not validated. am: f1120be78b
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1718510

Change-Id: I4135072382e447206ef7634e6e43b7ad5186a00d
2021-07-02 06:43:20 +00:00
Lorenzo Colitti
05752a5316 Merge changes from topic "conn-diags-skipped"
* changes:
  Update ConnDiags CTS test to expect validation result SKIPPED.
  Report result SKIPPED in ConnDiags if the network is not validated.
2021-07-02 06:26:57 +00:00
Remi NGUYEN VAN
31dbe8b122 Merge "Remove workarounds to use core platform API" am: 78dcc73e4c
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1754889

Change-Id: Ia0f8f5ab44267b0007364e6c1959edf22c952300
2021-07-02 04:41:25 +00:00
Remi NGUYEN VAN
78dcc73e4c Merge "Remove workarounds to use core platform API" 2021-07-02 04:37:23 +00:00
Treehugger Robot
f780194b25 Merge "Test Entitlement when telephony is present" am: 93773f0aa0
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1735336

Change-Id: Ib5734aca35f2aee00d63b5684f6dd06b1063ef26
2021-07-02 04:37:15 +00:00
Treehugger Robot
93773f0aa0 Merge "Test Entitlement when telephony is present" 2021-07-02 04:28:18 +00:00
Remi NGUYEN VAN
b786afa6e3 Merge "Fix CtsNetTestCases in instant mode" am: 81be2bd036
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1753823

Change-Id: I84ec31354974c4913d6c4ac94a955054697180ff
2021-07-02 04:19:02 +00:00
Remi NGUYEN VAN
81be2bd036 Merge "Fix CtsNetTestCases in instant mode" 2021-07-02 04:07:05 +00:00
Paul Hu
9e98dea823 Merge "Change to REQUEST from LISTEN for mobile data preferred uids feature" am: 7079b72fa6
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1751023

Change-Id: I4c87ecdd3d05305aa47a7569a22f370aedf4b585
2021-07-02 01:26:27 +00:00
Paul Hu
7079b72fa6 Merge "Change to REQUEST from LISTEN for mobile data preferred uids feature" 2021-07-02 01:10:56 +00:00
Remi NGUYEN VAN
b2e919f9da Remove workarounds to use core platform API
Core platform API stubs are now correctly included in module_current and
system_server_current, so workarounds used to use such APIs can be
removed.

OsCompat and InetAddressCompat were only necessary because manually
adding the stubs did not resolve the problem for classes that had
public API stubs, which shadowed the module API stubs.

The manual stubs dependency was already removed in another change. Also
remove the service jar dependency on android_system_server_stubs_current
as it is already included in sdk_version system_server_current.

Bug: 183097033
Test: atest CtsNetTestCases

Change-Id: Id448be03b679f832edb24f1b77f471227faf5268
2021-07-02 10:05:07 +09:00
Cody Kesting
69ec69341e Update ConnDiags CTS test to expect validation result SKIPPED.
This CL updates ConnectivityDiagnosticsManagerTest to expect
NETWORK_VALIDATION_RESULT_SKIPPED for its TestNetworks. The tests also
expect a ConnectivityReport to be sent for all calls to
ConnectivityManager#reportNetworkConnectivity.

Bug: 162407730
Test: atest ConnectivityDiagnosticsManagerTest
Change-Id: I525ea22a38c54a6b5b969a70301852e7af12849c
2021-07-01 17:38:17 -07:00
Cody Kesting
f1120be78b Report result SKIPPED in ConnDiags if the network is not validated.
This CL updates ConnectivityDiagnostics to report
NETWORK_VALIDATION_RESULT_SKIPPED when the platform does not validate
the reported Network. This CL also updates the behavior for
ConnectivityManager#reportNetworkConnectivity, such that it will always
generate a ConnectivityReport on the reported network. If the reported
connectivity does not match the known connectivity of this network, the
network is revalidated and a report is generated. Otherwise,
revalidation is not performed and the cached ConnectivityReport is sent
instead.

This CL also updates ConnDiags behavior for calls to
ConnectivityManager#reportNetworkConnectivity. Specifically, ConnDiags
callbacks are only notified for these calls if:
  a) the call causes the Network to be re-validated, or
  b) the callback registrant was the caller of
     #reportNetworkConnectivity().
For b), the caller is always guaranteed to receive a ConnectivityReport
(a fresh report if the Network is re-validated, else the cached report).

Bug: 162407730
Test: atest FrameworksNetTests ConnectivityDiagnosticsManagerTest
Change-Id: I78b78919d5b0f09348dfdd5fdb37418b8c7f861f
2021-07-01 17:38:16 -07:00
Orion Hodson
cfa0d8026b Merge "Remove dependency on stable.core.platform.api.stubs" am: f15f2769b4
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1751523

Change-Id: I94b8ca7d55df35e5f118b69a07b5152b2d0b207b
2021-07-01 19:08:36 +00:00
Orion Hodson
f15f2769b4 Merge "Remove dependency on stable.core.platform.api.stubs" 2021-07-01 18:53:17 +00:00
Sudheer Shanka
f8110a2cda Merge "Skip tests on unsupported devices." am: 0dc6206752
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1753865

Change-Id: Icaea4cd21c2fa68e7340db2fe82a4b41687470a5
2021-07-01 17:16:06 +00:00
Sudheer Shanka
0dc6206752 Merge "Skip tests on unsupported devices." 2021-07-01 16:59:46 +00:00