* changes:
Make Tethering public API for DO/Carrier apps
Add stopTethering(TetheringRequest) stubs
Introduce interfaceName field into TetheringRequestParcel
Quang Luongauthored and Gerrit Code Reviewcommited 2024-12-05 04:59:31 +00:00
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 Luongcommited 2024-12-05 11:49:39 +09:00
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 Luongcommited 2024-12-05 08:32:10 +09:00
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 Colitticommited 2024-12-04 09:59:33 +00:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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 Groovercommited 2024-11-25 15:44:42 -06:00
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
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