Commit graph

107,718 commits

Message SHA1
Export com.android.net.flags for wifi apex
Bug: 216524590
Test: build
Change-Id: I74b71008b1d263adf07218a617f6c8bccb46cb67

Quang Anh Luong   commited 2024-12-19 09:54:16 +09:00
6d2bbcefd2
Merge changes I9fb420ec,If00a7dc5,I8025cc2e into main
* changes:
  Make Tethering public API for DO/Carrier apps
  Add stopTethering(TetheringRequest) stubs
  Introduce interfaceName field into TetheringRequestParcel

Quang Luong   authored and   Gerrit Code Review   commited 2024-12-05 04:59:31 +00:00
495fe09110
Make Tethering public API for DO/Carrier apps
Make a limited subset of Tethering APIs public for DO/Carrier apps
to start Wifi tethering with a custom SoftApConfiguration.

The following APIs are needed to be moved to public
- TetheringManager
    - startTethering
    - stopTethering
    - registerTetheringEventCallback
    - unregisterTetheringEventCallback
- TetheringManager.TetheringRequest
    - getSoftApConfiguration
- TetheringManager.TetheringRequest.Builder
    - setSoftApConfiguration
- TetheringInterface
- TetheringEventCallback
    - onTetheredInterfacesChanged

Checks for DO/Carrier apps will be added in a later CL.

API-Coverage-Bug: 374400379

Bug: 216524590
Test: atest TetheringTest TetheringManagerTest
Change-Id: I9fb420ec6cebea17d8f3bc40a0ae8735074d9eb0

Quang Anh Luong   commited 2024-12-05 11:49:39 +09:00
2f37e81851
Add stopTethering(TetheringRequest) stubs
Add a new API TetheringManager.stopTethering(TetheringRequest) to allow
apps to stop tethering for a specific request.

This CL only provides the API stubs. Implementation will be added in a
future CL.

Bug: 216524590
Test: atest TetheringManagerTest

Change-Id: If00a7dc5d328dac620fb69c384378c36e99e1856

Quang Anh Luong   commited 2024-12-05 08:32:10 +09:00
5475f2dd74
Introduce interfaceName field into TetheringRequestParcel
Bug: 340376953
API-Coverage-Bug: 365678805
Test: Presubmit
Test: atest EthernetTetheringTest
Test: atest TetheringTest
Test: atest NsdManagerDownstreamTetheringTest -b
Test: atest TetheringManagerTest -b

Change-Id: I8025cc2e238b8f9516bf18d8ea0253f1c58a05e6

Seungjae Yoo   authored and   Quang Anh Luong   commited 2024-12-05 08:14:10 +09:00
eab1de47f4
Merge "Make ARM TVs running 32-bit userspace boot on V with new kernels." into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2024-12-04 19:11:24 +00:00
6eee50614d
Make ARM TVs running 32-bit userspace boot on V with new kernels.
This unblocks building and testing for these devices on V only.
Networking may not work correctly, but at least the device will
boot.

Fix: 374252805
Test: cannot be tested due to lack of devices
Change-Id: I5be400d825bf7486454ff34e17123adac81a4447

Lorenzo Colitti   commited 2024-12-04 09:59:33 +00:00
d95c0c692c
Merge "Skip NetworkStatsBinderTest if the binder interface is not accessible." into main
Junyu Lai   authored and   Gerrit Code Review   commited 2024-12-04 07:22:28 +00:00
729914733a
Merge "Add RtmNetlinkPrefixMessage class to represent RTM_NEWPREFIX message." into main
Xiao Ma   authored and   Gerrit Code Review   commited 2024-12-04 04:41:43 +00:00
7dd2525646
Merge "Read idle timer configurations from the boot namespace" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-12-04 00:18:39 +00:00
9f5b77180e
Add RtmNetlinkPrefixMessage class to represent RTM_NEWPREFIX message.
Bug: 315069348
Test: atest NetworkStaticLibTests
Change-Id: I566fa6fcc85a19dab8edf2dccb356a53fdc8e6b2

Xiao Ma   commited 2024-12-03 19:53:43 +09:00
cb0aabd14c
Skip NetworkStatsBinderTest if the binder interface is not accessible.
Following up from aosp/3313055, the binder interface getUidStats(II)J
is removed from the module. Currently, the test catches
NoSuchMethodException for reflection.
But did not properly skip for NoSuchMethodError which is thrown by
the java runtime when a method was present during compilation is
no longer available.

Test: cts-tradefed run commandAndExit cts -m CtsNetTestCases -t \
     android.net.cts.NetworkStatsBinderTestinderTest
Bug: 378982661
Change-Id: I7b8baa7ab98ce0114541bf1a9568db6f832213b6

Junyu Lai   commited 2024-12-03 15:26:16 +08:00
05b57b7724
Merge "Add mcts and mcts-tethering to net-tests-utils-host-common for the dependency of ConnectivityTestPreparer" into android15-tests-dev am: 900fb00793
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3381265

Change-Id: I92961a480281fc239dcde1d0cf0480cbbd496486
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Tongbo Liu   authored and   Automerger Merge Worker   commited 2024-12-03 03:34:40 +00:00
4f1c1ea358
Merge "Add mcts and mcts-tethering to net-tests-utils-host-common for the dependency of ConnectivityTestPreparer" into android15-tests-dev
Tongbo Liu   authored and   Gerrit Code Review   commited 2024-12-03 03:17:50 +00:00
900fb00793
Read idle timer configurations from the boot namespace
The values are only read during startup so moving these to a boot
namespace. This will ensure that the values are committed to logs only
after a boot.

The boot namespace is already provisioned, but going forward the
string constants for the namespace do not need to be defined in the
DeviceConfig module.

Test: atest ConnectivityCoverageTests:\
android.net.connectivity.com.android.server.CSNetworkActivityTest

Test: Manually using shell commands. E.g.:
adb shell device_config put tethering_boot \
cellular_data_inactivity_timeout 4

Bug: 377759682
Change-Id: Icd4bd3da288e5dfde620d779bd0708319da90be9

Suprabh Shukla   commited 2024-12-02 16:22:10 -08:00
392336b50d
Merge "Remove unnecessary semicolon" into main
Yuyang Huang   authored and   Gerrit Code Review   commited 2024-12-02 13:39:40 +00:00
2fa511bdc2
Remove unnecessary semicolon
Test: TH
Change-Id: Icfb415f9ba60860b2c066275d7936adfbb37e30f

Yuyang Huang   commited 2024-12-02 20:04:25 +09:00
fb2425d173
Remove synchronized block for test only variable
This is to address review comments at aosp/3324247, where
the test only methods are pretty much always single-threaded.
Remove the synchronized block accordingly.

Test: TH
Bug: 372851500
Change-Id: I14209b090c584912fcb87f5734f57ef3db7b0f3c

Junyu Lai   commited 2024-12-02 07:04:20 +00:00
219d7f9275
Add mcts and mcts-tethering to net-tests-utils-host-common for the dependency of ConnectivityTestPreparer
Bug: 379792488
Change-Id: I725bc9d7fed7df23ccc21d1f4dc4fa10e0315cc9

Tongbo Liu   commited 2024-12-02 03:11:19 +00:00
17ab27e71f
Merge "Only report tryTest errors when not caught" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-12-02 01:48:40 +00:00
739a6c4320
Wait after putting a display to sleep in ApfIntegrationTest in Automotive Multi Display configuration instead of polling for interactiveness am: 799aed88ad
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3383434

Change-Id: Id3877c013820381eb642149352329fd35a2b6b4a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Antonio Kantek   authored and   Automerger Merge Worker   commited 2024-12-02 01:10:36 +00:00
d437ad8dd6
Only report tryTest errors when not caught
Instead of reporting tryTest errors when the tryTest block throws,
report them in the cleanup block if no catch block has caught it.

This fixes a bug where tests that use tryTest/catch would collect
diagnostics in expected cases.

Test: atest
Change-Id: Ic53ae54f1945a2784becd50e5890fad8e7461474

Remi NGUYEN VAN   commited 2024-12-02 09:26:53 +09:00
fc724ab59a
Wait after putting a display to sleep in ApfIntegrationTest in Automotive Multi Display configuration instead of polling for interactiveness
Testing if a display has been put to sleep does not yet work in Automotive Multi Display configuration as PowerManager#isInteractive is not yet per-display.

This is a pre-condition changelist to enable CtsNetTestCases for secondary users on secondary displays.

Bug: 374210153
Bug: 330610015
Test: atest CtsNetTestCases:android.net.cts.ApfIntegrationTest
Flag: TEST_ONLY
Change-Id: I3197b051002fcf20309692eab682a0c7db7844f7

Antonio Kantek   commited 2024-12-01 21:06:13 +00:00
799aed88ad
Merge "Wait after putting a display to sleep in ApfIntegrationTest in Automotive Multi Display configuration instead of polling for interactiveness" into main
Antonio Kantek   authored and   Gerrit Code Review   commited 2024-12-01 03:28:21 +00:00
b4a2a5a1ce
Merge "Add isDebuggable() to DeviceInfoUtils for Android R compatibility" into main
Yuyang Huang   authored and   Gerrit Code Review   commited 2024-11-29 10:11:14 +00:00
6ac23bd155
Merge "Simplify the Android CT properties" into main
Sandro Montanari   authored and   Gerrit Code Review   commited 2024-11-29 09:38:04 +00:00
54fdf07038
Merge "Fix assertEventuallyTrue timeout" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-11-29 09:01:18 +00:00
bb3b38d71e
Fix assertEventuallyTrue timeout
A nanosecond is 1E6 milliseconds, not 1000.

Test: atest
Change-Id: Iaa5fc15b4dc5a735d1a7bdbf7642c1376d2f41d9

Remi NGUYEN VAN   commited 2024-11-29 16:28:16 +09:00
2229796976
Add isDebuggable() to DeviceInfoUtils for Android R compatibility
Introduced the isDebuggable() helper method in DeviceInfoUtils. This
method provides a consistent way to determine if the device is in
debuggable mode across different Android versions. Since
Build.isDebuggable() is not available in Android R, the method checks
the "ro.debuggable" system property as a fallback, ensuring
compatibility.

Bug: 381327071
Test: TH
Change-Id: Ibf77bcfc50378d88458baf07683e7bf2065734de

Yuyang Huang   commited 2024-11-29 15:38:21 +09:00
bb815f25dd
Merge "Add a new module-only API to preload HttpEngine" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-11-29 05:10:06 +00:00
c3a2764012
Merge "Add QUIC testing to test preparer" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-11-29 01:15:18 +00:00
323c15448a
Add QUIC testing to test preparer
In addition to verifying that the wifi network is validated, also verify
that it can use QUIC on both IPv4 and IPv6.

This makes setup issues more obvious and avoids blaming individual
tests, by failing the whole module in case devices are connected to
access points that do not meet the test prerequisites.

The QUIC test (including the test packet) is mostly taken from
NativeMultinetworkJni.cpp and written in Kotlin.

Test: atest
Change-Id: I1c0381e1ad4146d4827fbc1bf095da13dfe3d124

Remi NGUYEN VAN   commited 2024-11-29 08:42:51 +09:00
cc8b8f9165
Simplify the Android CT properties
Since we are moving away from runtime flags, the CT URLs for the log
list, signature, and public key will be hardcoded. I took the occasion
to simplify the logic for handling the Android CT properties and removed
the various "_PENDING" properties. They were making everything much
harder to follow.

Flag: com.android.net.ct.flags.certificate_transparency_job
Bug: 319829948
Test: NetworkSecurityUnitTests
Change-Id: I74bb946eccb5f376ee161ace2f151bf6ea1bdcff

Sandro Montanari   commited 2024-11-28 14:42:09 +00:00
9190aed0f8
Merge "Change ethernet enabled state from int to using boolean" into main
Chuwei He   authored and   Gerrit Code Review   commited 2024-11-28 04:26:46 +00:00
dd87fb0d06
Change ethernet enabled state from int to using boolean
Previously, EthernetTracker uses int to store ethernet enabled state.
Since ethernet enabled state only has 2 possible values
(disabled/enabled), this patch simplified the state representation into
using boolean instead.

Bug: None
Test: atest EthernetManagerTest
Change-Id: Id0b2c8da244c3aa09cb20f2fb67078f2cb4cbe56

Chuwei He   commited 2024-11-28 10:06:45 +09:00
9efa5f8824
Add SignatureVerifier class to handle public keys from different sources
The SignatureVerifier class allows setting a public key either as a
string or as a file. The former method is used when the key is read from
a flag via the CertificateTransparencyFlagsListener. The latter method
is used when the key is downloaded as a file by the daily
CertificateTransparencyJob.

This CL also adds an additional step to download a public key from a
URL via the CertificateTransparencyDownloader. Now the class goes
through the following steps:
1. Download a public key from the public key url,
2. If successful, download a log list signature from the metadata url,
3. If successful, download log list from the content url,
4. If successful, verifiy the log list using signature and public key,
5. If successufl, install the log list.

I also realized the CertificateTransparencyDownloaderTest was really
hard to understand, even for me that I wrote it xD
I attempted to clean up the test, hopefully it is a bit clearer now.
I'll probably make a second simplification pass in a follow-up CL.

Flag: com.android.net.ct.flags.certificate_transparency_job
Bug: 319829948
Test: NetworkSecurityUnitTests
Change-Id: I2be3e8b5895182d2afd8161aa44e54e1a6021685

Sandro Montanari   commited 2024-11-27 09:49:01 +00:00
3bd07a5ec6
Merge changes I2dd18f9d,I5cc02c8a into main
* changes:
  Stop tethering when the current user is not allowed to do entitlement check
  Use TestableResultReceiver in EntitlementManagerTest

Junyu Lai   authored and   Gerrit Code Review   commited 2024-11-27 04:33:45 +00:00
25e0517124
Stop tethering when the current user is not allowed to do entitlement check
This commit ensures that EntitlementManager sends the appropriate
error code to the receiver when the current user is not allowed
to perform entitlement check. This error code also listened by
the tethering module, where it would stop tethering when receiving
such error code.

Test: atest TetheringTests:EntitlementManagerTest
Bug: 376792293
Change-Id: I2dd18f9df9ad7cab542f8877b9fc86600c248144

Junyu Lai   commited 2024-11-27 10:56:05 +08:00
0adbb0277b
Use TestableResultReceiver in EntitlementManagerTest
This is a test only refactoring which updates the unit tests to use a
TestableResultReceiver to have better readability, and asserting
no entitlement result received.

Test: atest TetheringTests:EntitlementManagerTest
Bug: 376792293
Change-Id: I5cc02c8ab85ae614e714055c7f8f4c076341f48f

Junyu Lai   commited 2024-11-27 10:36:22 +08:00
5671e9d15d
Wait after putting a display to sleep in ApfIntegrationTest in Automotive Multi Display configuration instead of polling for interactiveness
Testing if a display has been put to sleep does not yet work in Automotive Multi Display configuration as PowerManager#isInteractive is not yet per-display.

This is a pre-condition changelist to enable CtsNetTestCases for secondary users on secondary displays.

Bug: 374210153
Bug: 330610015
Test: atest CtsNetTestCases:android.net.cts.ApfIntegrationTest
Flag: TEST_ONLY
Change-Id: I3197b051002fcf20309692eab682a0c7db7844f7

Antonio Kantek   commited 2024-11-27 02:35:55 +00:00
fa168e528b
Merge "Expose Connectivity libraries to VCN and tests" into main
Yan Yan   authored and   Gerrit Code Review   commited 2024-11-27 00:34:33 +00:00
e0e0636fa9
Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I647fddd00b1ee970859291468d481dd5bbfea0e6

Bill Yi   commited 2024-11-26 06:00:10 -08:00
2c15bee348
Merge "Create the timerfd helper class" into main
Paul Hu   authored and   Gerrit Code Review   commited 2024-11-26 08:23:21 +00:00
38bbfa8c82
Merge "Fix TetheringManagerTest using setWifiSsid before T" into main
Quang Luong   authored and   Gerrit Code Review   commited 2024-11-26 07:28:36 +00:00
bb4d3a1b6d
Merge "Add WRITE_ALLOWLISTED_DEVICE_CONFIG perm when modifying DeviceConfig" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-11-26 07:18:26 +00:00
7f18aa1121
Add WRITE_ALLOWLISTED_DEVICE_CONFIG perm when modifying DeviceConfig
Android 16 introduces restrictions on the DeviceConfig flags that
can be modified by the shell user by removing the WRITE_DEVICE_CONFIG
permission from this user and replacing it with the
WRITE_ALLOWLISTED_DEVICE_CONFIG permission; with this permission,
only those flags that have been allowlisted can be modified. This
commit adds the ALLOWLISTED permission to any test that explicitly
adopts the shell permission identity with the WRITE_DEVICE_CONFIG
permission; the WRITE_DEVICE_CONFIG permission is not removed to
ensure tests do not break when run on previous platform releases
without the ALLOWLISTED permission.

Bug: 364083026
Flag: TEST_ONLY
Test: Manually ran all modified tests
Change-Id: I01124581b122b34d45b22a8bd5cb89867ad086a6

Michael Groover   commited 2024-11-25 15:44:42 -06:00
b8eca6d9e0
[automerger skipped] Fix CtsNetTestCases for secondary_user_on_secondary_display am: 92071eea46 -s ours
am skip reason: Merged-In I02ae287a926e0bce69ed11fa7e0ef78b288b6b76 with SHA-1 c91d1654f1 is already in history

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3374763

Change-Id: Ic874d5833d968c37d1f361e16fcdc4662f0fc6ca
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Xiang Wang   authored and   Automerger Merge Worker   commited 2024-11-25 17:56:54 +00:00
1100aed98b
Fix CtsNetTestCases for secondary_user_on_secondary_display
secondary_user_on_secondary_display is for background users that have
access to UI on assigned displays (a.k.a. visible background users) on devices that have config_multiuserVisibleBackgroundUsers enabled. The main use case is Automotive's multi-display configuration where passengers (modeled as visible background users) can interact with the display in front of them concurrently with the driver (modeled as the the current user) interacting with the driver's display.

The fix is to pass in the user id to appops commands so that appops permissions can be properly granted or denied to a visible background user (non current user).

Bug: 374210153
Flag: EXEMPT test fix
Test: Tested on Automotive reference hardware with Multi Display
Test: atest android.net.cts.IpSecManagerTunnelTest
Test: atest --user-type secondary_user_on_secondary_display android.net.cts.IpSecManagerTunnelTest
Test: atest android.net.cts.Ikev2VpnTest
Test: atest --user-type secondary_user_on_secondary_display android.net.cts.Ikev2VpnTest
Test: atest android.net.cts.NetworkStatsManagerTest
Test: atest --user-type secondary_user_on_secondary_display android.net.cts.NetworkStatsManagerTest
(cherry picked from https://android-review.googlesource.com/q/commit:116a3a7bd0d1e80adf3258850180f60dc90a3a94)
Merged-In: I02ae287a926e0bce69ed11fa7e0ef78b288b6b76
Change-Id: I02ae287a926e0bce69ed11fa7e0ef78b288b6b76

Xiang Wang   commited 2024-11-25 07:37:29 +00:00
92071eea46
Merge "Fix CtsNetTestCases for secondary_user_on_secondary_display" into main
Xiang Wang   authored and   Gerrit Code Review   commited 2024-11-25 07:36:52 +00:00
df55e35227
Fix CtsNetTestCases for secondary_user_on_secondary_display
secondary_user_on_secondary_display is for background users that have
access to UI on assigned displays (a.k.a. visible background users) on devices that have config_multiuserVisibleBackgroundUsers enabled. The main use case is Automotive's multi-display configuration where passengers (modeled as visible background users) can interact with the display in front of them concurrently with the driver (modeled as the the current user) interacting with the driver's display.

The fix is to pass in the user id to appops commands so that appops permissions can be properly granted or denied to a visible background user (non current user).

Bug: 374210153
Flag: EXEMPT test fix
Test: Tested on Automotive reference hardware with Multi Display
Test: atest android.net.cts.IpSecManagerTunnelTest
Test: atest --user-type secondary_user_on_secondary_display android.net.cts.IpSecManagerTunnelTest
Test: atest android.net.cts.Ikev2VpnTest
Test: atest --user-type secondary_user_on_secondary_display android.net.cts.Ikev2VpnTest
Test: atest android.net.cts.NetworkStatsManagerTest
Test: atest --user-type secondary_user_on_secondary_display android.net.cts.NetworkStatsManagerTest
Change-Id: I02ae287a926e0bce69ed11fa7e0ef78b288b6b76

Xiang Wang   commited 2024-11-25 06:32:37 +00:00
c91d1654f1