As per `Iad43a122407fe438cab94f59ed8aba8d6080af02` commit, this test is no longer running on automotive.
This changelist also skips this test on Android Automotive within the setupOnce (@BeforeClass) method to avoid
executing unnecessary SLEEP/WAKEUP logic.
Fix: 439953326
Test: atest CtsNetTestCases:ApfIntegrationTest
Test: presubmit
Flag: TEST_ONLY
Change-Id: Ic96db7a5dbc3f793bef85d9d3cd10cbcf726c7b4
Instead of iterating all listeners to get the FilterRepliesInfo,
this change introduces a new offloadInfo map to manage this
information. This map is updated when listeners are added/removed
or when a service is resolved. This ensures that the offload
information is always up-to-date and can be retrieved
efficiently.
Bug: 410734687
Test: atest ConnectivityCoverageTests
Flag: EXEMPT refactor
Change-Id: I89270c58304eec9fe9c3ed63dfbd46dab788a39f
Unifies the `TETHERING_LOCAL_NETWORK_AGENT` and
`WIFIP2PGO_LOCAL_NETWORK_AGENT` legacy feature flags into a
single mainline beta aconfig flag:
`tethering_and_p2p_go_local_network_agent`.
This change simplifies the logic for enabling the `NetworkAgent`
for both standard tethering (global scope) and Wi-Fi P2P Group
Owner mode (local scope). The agent is now enabled for both use
cases when the new flag is on.
The implementation in `IpServer` and associated tests have
been updated to use the new unified flag.
Flag: com.android.tethering.mainline.beta.tethering_and_p2p_go_local_agent
Bug: 420590461
Test: atest TetheringTests
Test: adb root
adb shell device_config put com_android_tethering com.android.tethering.mainline.beta.tethering_and_p2p_go_local_agent true
adb reboot
atest CtsTetheringTest --test-filter '.*Agent.*'
Test: atest ConnectivityCoverageTests:android.net.ip.IpServerTest --update-device
Change-Id: I55817132c57a04b4f7b7bac61b5741f45ba16182
Updated LocalNetAccessKey to use Type.IpAddress for its
`remoteAddress` BPF field. This enables the BPF map to
store both IPv4 and IPv6 addresses for this key.
To ensure proper functionality with IPv6 addresses, a new
unit test, `testAddLocalNetAccessAfterV_withIPv6`, has been
added to BpfNetMapsTest.java. This test specifically
verifies adding and retrieving local network access rules
using an IPv6 remote address.
Bug: 392509494
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.BpfNetMapsTest
Flag: EXEMPT refactor
Change-Id: I005f4f2b778ca2d3a4e6578c1440162532f8d004
If an app registers a network agent and doesn't have NETWORK_FACTORY or
PERMISSION_MAINLINE_NETWORK_STACK, but does have
CREATE_APP_SPECIFIC_NETWORK, ConnectivityService will:
- Allow it to create a network
- Force the capabilities to contain only the app's UID
- Force the network to be restricted
- Ignore attempts to change the UID or make the network non-restricted
Test: TH
Flag: android.net.platform.flags.create_app_specific_network_permission
Bug: 435313135
Change-Id: I5a9517515e64f799c88aca4a51636b1a08e15817
MdnsSocketProvider expects no overlap between NetworkCallbacks,
Tethering, and Wifi P2P. However, local NetworkAgents can cause
overlap, leading to duplicate sockets. This commit fixes the issue by
skipping networks with NET_CAPABILITY_LOCAL_NETWORK.
Alternatively, the NetworkRequest should addForbiddenCapability
for local networks. However, since this is a module API, it is
not visible to standalone applications.
Flag: EXEMPT bug fix
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.connectivity.mdns.MdnsSocketProviderTest \
--update-device
Test: m service-connectivity-mdns-standalone-build-test
Test: atest CtsNetTestCases:android.net.cts.NsdManagerTest \
CtsNetTestCases:android.net.cts.NsdManagerDownstreamTetheringTest
Bug: 437038495
Change-Id: I78dd7d98ad80147ca26ec6130b6081ef4efb2ecc
Import `FLAG_QUEUE_NETWORK_AGENT_EVENTS_IN_SYSTEM_SERVER` and use
its alias in Connectivity Service tests.
Flag: com.android.tethering.mainline.beta.queue_network_agent_events_in_system_server
Fix: 428098184
Test: m
Change-Id: Ic4b5a144c00919defbd7a29048957f028c80bf4a
Add `queue_network_agent_events_in_system_server` as a mainline beta
flag. This flag replaces the previous check for
`mQueueNetworkAgentEventsInSystemServer`, allowing the feature to be
controlled and enabled on all Android versions via mainline beta program.
Flag: com.android.tethering.mainline.beta.queue_network_agent_events_in_system_server
Test: atest ConnectivityCoverageTests --update-device \
--test-filter '.*NetworkAgent.*'
Test: atest ConnectivityCoverageTests --update-device \
--test-filter '.*Connectivity.*'
Fix: 428098184
Change-Id: I96b0443bd4c55c28d482349738bbdc4798f0c7f9
This commit adds the OffloadCallback, which is a common interface
to notify the offload service of info updates from MdnsAdvertiser.
Bug: 410734687
Test: atest ConnectivityCoverageTests NsdManagerTest
Flag: EXEMPT legacy refactor
Change-Id: I6bb7fe2b0e4ced4aff9062566d9bcf075893e6fc
which allows writes, but not deletes.
This is technically what bpf map arrays are capable of.
Test: TreeHugger
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I1f73bea5428c190af17442539c296282ce9e0786
Maciej Żenczykowskicommited 2025-08-09 16:03:46 -07:00
Annotate APFv6 multi-device tests with `@CddTest`.
This marks these tests for compliance with specific CDD requirements.
Flag: EXEMPT test only
Bug: 437029299
Test: atest CtsConnectivityMultiDevicesTestCases:ApfV6Test
Change-Id: I686ca609c3f34daf106673e429c49b8776c97923
Annotate APFv4 multi-device tests with `@CddTest`.
This marks these tests for compliance with specific CDD requirements.
Flag: EXEMPT test only
Bug: 437034146
Test: atest CtsConnectivityMultiDevicesTestCases:ApfV4Test
Change-Id: Ibdd4c1652e21a708d5ddde79ecedbe258e318ac3
The mobile data preferred feature stores the list of UIDs in
Settings.Secure, which is per-user. But the code only sets, reads
and observes the setting for the current user instead of for all
users. This does not work on HSUM or automotive.
Fix this as follows:
- Register the ContentObserver on UserHandle.ALL
- Any time the observer fires, read the setting on all current
users, and operate on the merged result.
- Ensure that the code gets called on ACTION_USER_ADDED and
ACTION_USER_REMOVED.
Because the code now aggregates the setting for all UIDs, it
should just work on single-user devices. It should also work if
there are OEM devices that store all UIDs (for all users) in
Settings.Secure for user 0.
Because the bug is fixed, re-enable the test on automotive.
Also fix style nits.
Fix: 404186833
Flag: EXEMPT bug fix
Test: covered by existing CTS tests
Change-Id: I69ad789f1c7c7f3bab04ab8789dfb93ee0de553d
Lorenzo Colitticommited 2025-08-08 15:36:55 +09:00
ConnectivityService uses SettingsObservers to detect when
settings change. These are all set on user zero. This is fine
for most settings, which are in Settings.Global, but some
settings are per-user, such as MOBILE_DATA_PREFERRED_UIDS, which
is in Settings.Secure.
This CL adds the ability to register SettingsObservers on all
users. These observers will fire any time the setting changes
for any current user, and any time a user is added or removed.
This CL does not add or change any SettingsObservers and should
cause no behaviour changes.
Bug: 404186833
Flag: EXEMPT refactor
Test: covered by existing tests
Change-Id: I5954b196eea776414098f1ce4441eb02065438ef
Lorenzo Colitticommited 2025-08-08 15:36:54 +09:00
(mostly autogenerated, with minor tweaks to make it build)
Test: TreeHugger
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I2065c3fc6d4d37663a0a52281deb7624fd5c801d
Maciej Żenczykowskicommited 2025-08-07 15:52:35 -07:00
(mostly autogenerated, with minor tweaks to make it build)
Test: TreeHugger
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Id2ffe0df6526a6377806464e902b8e8f87a43c62
Maciej Żenczykowskicommited 2025-08-07 15:50:48 -07:00
Annotate APFv4 and APFv6 multi-device tests with `@VsrTest`.
This marks these tests for compliance with specific VSR requirements,
Flag: EXEMPT test only
Test: atest CtsConnectivityMultiDevicesTestCases:ApfV4Test
Test: atest CtsConnectivityMultiDevicesTestCases:ApfV6Test
Test: ./cts-tradefed run cts \
-m CtsConnectivityMultiDevicesTestCases \
-t ApfV4Test --shard-count 2
Test: ./cts-tradefed run cts \
-m CtsConnectivityMultiDevicesTestCases \
-t ApfV6Test --shard-count 2
Change-Id: I864aa65f6f4d584c4f8077f98aac0b0da8e501c8
This patch add *Proto suffix for some proto message in
NetworkConfigStoreProto to avoid name conflicts with names in
android.net package.
Test: atest ConnectivityCoverageTests
Bug: 397536853
Flag: EXEMPT mainline
Change-Id: I4f826511bcab0fcd3b154bbc349a062fd4841321
AServiceManager_waitForService sytem APIs currently only callable
via dlsym(): b/376759605. When built with sdk_version current,
the NDK stubs for "sdk" variants only include NDK APIs,
excluding #systemapi APIs.
Flag: EXEMPT Mechanical refactors
Test: atest ServiceManagerWrapperIntegrationTest
Change-Id: I48f690d771c7905e79e463617ded772f753cc854
Mark Chienauthored and Patrick Rohrcommited 2025-08-06 10:44:39 -07:00
Currently, NET_CAPABILITY_NOT_VCN_MANAGED is implicited added for
NetworkRequest built by normal apps.
However, the tethering network agent doesn't have this capability,
which makes the agent being exposed to VcnManager and cannot be
seen by normal apps.
Add NET_CAPABILITY_NOT_VCN_MANAGED to tethering NetworkAgent. Include
NET_CAPABILITY_NOT_VCN_MANAGED in local network capabilities for
metrics and API utilities to ensure correct evaluation of local
network connectivity. Update unit tests to reflect the new capability.
Flag: EXEMPT bug fix
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.CSSatisfiedByLocalNetworkMetricsTest \
ConnectivityCoverageTests:android.net.connectivity.com.android.metrics.SatisfiedByLocalNetworkMetricsTest \
--update-device
Test: manual generate request by CTS and statsd_testdrive -e 10247
Bug: 428098173
Change-Id: Ifa9ce0827abd22d887a0e8a2ab6f4d7391b2b8ed
Because FakeSettingsProvider and other test infrastructure did
not support settings observers, the tests called internal
ConnectivityService methods to cause the settings to be re-read.
Now that FakeSettingsProvider supports callbacks, use
ContentResolverWithFakeSettingsProvider in the CS tests and just
use the callbacks.
Bug: 397521796
Flag: TEST_ONLY
Test: test-only change
Change-Id: I26d8e98706fec99aa423721bf1474af2f9b60099
Lorenzo Colitticommited 2025-08-05 18:02:02 +09:00
Mocking the PackageManager while ConnectivityService is running
could throw an UnfinishedStubbingException. This change splits
the test into two distinct tests that don't need to change the
mocking value for PackageManager during testing.
Fix: 433600031
Test: atest ConnectivityServiceTest
Flag: TEST_ONLY
Change-Id: Ibcff2082d1e50e89c272573b4c719a7325c959fd
aosp/3201971 and aosp/3208090 updated ConnectivityService not to add
filtering rule for TYPE_VPN_LEGACY and TYPE_VPN_OEM to fix the issue in
b/352424251
This CL adds tests to veirfy the fix.
Test: NetworkAgentTest
Bug: 364982471
Flag: EXEMPT test only change
Change-Id: Ic3c108b9018f2137c1ae870a88c06e03518874c6