This commit addresses an issue where the VPN bypass feature was not
functioning correctly. The VPN filter has been updated to properly
handle bypass rules, ensuring that designated traffic can now bypass the
VPN as intended.
Test: TH, manual
Flag: EXEMPT guarded by default-off legacy flag
Change-Id: Ie6073db4e23a3132042da21c25b696fa3abc4c91
Lorenzo Colittiauthored and Yuyang Huangcommited 2025-09-11 11:50:05 +09:00
This patch adds util methods to convert StaticIpConfiguration from its
proto equivalent, and also adds unit tests to test the conversion.
Test: atest ConnectivityCoverageTests
Bug: 397536853
Flag: EXEMPT mainline
Change-Id: Iba4955efac3b854684f0d0f32b6d5667cebdc265
This patch adds util methods to convert StaticIpConfiguration to its
proto equivalent, and also adds unit tests to test the conversion.
Test: atest ConnectivityCoverageTests
Bug: 397536853
Flag: EXEMPT mainline
Change-Id: I1bd5683202bc0e144e195b4915721e7f414c95cf
The assertion that the app was removed from the list was due to
the fact that when adding the same UID twice, the code first
removes it and then re-adds it.
Add a bit more test coverage.
Test: test-only change
Flag: EXEMPT TEST_ONLY
Change-Id: I1eda5be93668ebda7fe2049a2d1ace4e744948e7
Lorenzo Colitticommited 2025-09-05 19:10:51 +09:00
This is currently very simple, but should be easy to extend.
Test: test-only change
Flag: EXEMPT TEST_ONLY
Change-Id: Ibcb286dcef0b159f01faf3dd0a17c977a7d60a52
Lorenzo Colittiauthored and Yuyang Huangcommited 2025-09-05 15:13:23 +09:00
This patch adds util methods to convert EthernetPortSelector to and from
its proto equivalent, and also adds unit tests to test the conversion.
Test: atest ConnectivityCoverageTests
Bug: 397536853
Flag: EXEMPT mainline
Change-Id: I0603c7a4004a83448c3d6ec4c1d0c6149708fd9d
This patch adds util methods to convert LinkAddress to and from
its proto equivalent, and also adds unit tests to test the conversion.
Test: atest ConnectivityCoverageTests
Bug: 397536853
Flag: EXEMPT mainline
Change-Id: I66243dc94f9b2619551f957c698b3bc0c285aced
This patch adds util methods to convert MeteredOverride to and from
its proto equivalent, and also adds unit tests to test the conversion.
Test: atest ConnectivityCoverageTests
Bug: 397536853
Flag: EXEMPT mainline
Change-Id: Ie19a19c1124e87b8e23a9b4e216e170e1cfb22b2
This will allow us to deprecate networkAddRoute.
Bug:412629841
Test: atest TetheringTests
Flag: EXEMPT Using device config kill-switch
Change-Id: I20e988f760b8ad22b51effdc1f0e204763c6e240
ConnectivityService would be centralized location for deciding local
network so for this effort passing isLocalRoute parameter to
routecontroller in netd for route addition, removal and modification.
Bug: 394308861
Test: Manually tested.
Test: atest ConnectivityCoverageTests
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.connectivityservice.CSLocalRouteTest
Test: atest netd_integration_test
Flag: EXEMPT Using device config kill-switch
Change-Id: I9f11882665375bba10fa369c2e25f374b5e63661
ConnectivityServiceTest can not start QuicConnectionCloser and was
getting the following error.
The interaction between ConnectivityService and QuicConnectionCloser is
already covered by CSDestroySocketTest.
```
08-26 18:53:53.469 6243 11101 E QuicConnectionCloser: [SkDestroyListener] ERROR Failed to create rtnetlink socket: socket failed: EACCES (Permission denied)
08-26 18:53:53.469 6243 11101 E QuicConnectionCloser: android.system.ErrnoException: socket failed: EACCES (Permission denied)
08-26 18:53:53.469 6243 11101 E QuicConnectionCloser: at libcore.io.Linux.socket(Native Method)
08-26 18:53:53.469 6243 11101 E QuicConnectionCloser: at libcore.io.ForwardingOs.socket(ForwardingOs.java:821)
08-26 18:53:53.469 6243 11101 E QuicConnectionCloser: at libcore.io.BlockGuardOs.socket(BlockGuardOs.java:402)
08-26 18:53:53.469 6243 11101 E QuicConnectionCloser: at libcore.io.ForwardingOs.socket(ForwardingOs.java:821)
08-26 18:53:53.469 6243 11101 E QuicConnectionCloser: at android.system.Os.socket(Os.java:834)
08-26 18:53:53.469 6243 11101 E QuicConnectionCloser: at android.net.connectivity.com.android.net.module.util.ip.NetlinkMonitor.createFd(NetlinkMonitor.java:127)
08-26 18:53:53.469 6243 11101 E QuicConnectionCloser: at android.net.connectivity.com.android.net.module.util.FdEventsReader.createAndRegisterFd(FdEventsReader.java:217)
08-26 18:53:53.469 6243 11101 E QuicConnectionCloser: at android.net.connectivity.com.android.net.module.util.FdEventsReader.start(FdEventsReader.java:111)
08-26 18:53:53.469 6243 11101 E QuicConnectionCloser: at android.net.connectivity.com.android.server.connectivity.QuicConnectionCloser$$ExternalSyntheticLambda1.run(D8$$SyntheticClass:0)
08-26 18:53:53.469 6243 11101 E QuicConnectionCloser: at android.os.Handler.handleCallback(Handler.java:959)
08-26 18:53:53.469 6243 11101 E QuicConnectionCloser: at android.os.Handler.dispatchMessage(Handler.java:100)
08-26 18:53:53.469 6243 11101 E QuicConnectionCloser: at android.os.Looper.loopOnce(Looper.java:232)
08-26 18:53:53.469 6243 11101 E QuicConnectionCloser: at android.os.Looper.loop(Looper.java:317)
08-26 18:53:53.469 6243 11101 E QuicConnectionCloser: at android.os.HandlerThread.run(HandlerThread.java:85)
```
Bug: 311792075
Test: atest ConnectivityServiceTest
Flag: EXEMPT test only change
Change-Id: I8ae1033b2ea655ebc26300aac19ec4d8cbdc047d
This renaming is to align the DiscoveryManager design and reflect
its real usage.
Bug: 410734687
Test: atest ConnectivityCoverageTests NsdManagerTest
Flag: EXEMPT rename method only
Change-Id: I0d198aa0752ef51353e4164b612b6ff268ace16a
With this change, the OffloadEngine can receive updates when
offload service information changes from DiscoveryManager. This
allows the OffloadEngine to maintain offload services and to
adjust its behavior accordingly.
Bug: 410734687
Test: atest ConnectivityCoverageTests
Flag: com.android.tethering.mainline.beta.nsd_selective_mdns_response_offload
Change-Id: I6c6ba4e76b4a2a94cbfef37bec9d6f87357bec5f
The service-side TrafficStats rate limit cache is no longer needed as
client-side caching is now solely responsible for rate-limiting traffic
stats queries.
This commit removes:
- The `clearTrafficStatsRateLimitCaches` AIDL method.
- The service-side cache implementation, including member variables and
logic within `NetworkStatsService`.
- Related feature flags and constants used for the service-side cache.
- All unit tests specifically for the service-side cache.
This simplifies the overall traffic statistics caching architecture by
centralizing rate-limiting responsibility on the client side.
Flag: EXEMPT refactoring
Test: atest ConnectivityCoverageTests --test-filter '.*NetworkStats.*' --update-device
Test: atest ConnectivityCoverageTests --test-filter '.*TrafficStats.*' --update-device
Fix: 428098676
Fix: 428097311
Change-Id: I41cbb80a52f04dcf387c3352677a91cb692ffe73
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
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
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
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
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