When using MdnsSocketClient (unused in the platform, may be used as a
library), allow guessing the Network of incoming packets based on their
source address.
This is flawed as there may be races between LinkProperties updates,
interfaces going up/down, and packets being received, and the source
address can not always be mapped 1:1 to an interface prefix, but it
should improve the situation for legacy code that currently assumes the
Network is the last one that was used for sending, which is often wrong.
Test: atest
Flag: EXEMPT: dead code in Android repo
Change-Id: I885c741d3d40b1b128a06b6d7a7aff8e0551ffea
This is hardcoded to true, and there is no use-case for setting it to
false.
Test: atest
Flag: EXEMPT refactor
Change-Id: I1c1b8f8ac4015adfa9900012c576312b5193433a
Move utility method responseMatchesOptions() to MdnsUtils, where
it can be used by other mDNS classes.
Bug: 387910548
Test: atest ConnectivityCoverageTests NsdManagerTest
Change-Id: Idecd5e7d4c2c4dcf108c42e07a7befd97b68b5a7
Revert submission 3561690-revert-3538339-SNUWWZJNJZ
Reason for revert: NewAPI error will be fixed by separate CL
Reverted changes: /q/submissionid:3561690-revert-3538339-SNUWWZJNJZ
Change-Id: Ia7367e9332f4d376bd0be4c03c095ee00de9177a
The EthernetConfigParser was adding the transportType on top of the
TRANSPORT_ETHERNET of DEFAULT_CAPABILITIES, causing multiple transport
types to be added.
This was causing an IllegalStateException when trying to set the
NetworkSpecifier within the EthernetNetworkFactory.
This only applies for when isAtLeastB && capabilitiesString.equals("*")
is true (as the parsed capability is equal to DEFAULT_CAPABILITIES).
Flag: TEST_ONLY
Bug: 405172885
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.ethernet.EthernetTrackerTest
Change-Id: I6678a52ddc87b8ad66c602c68335f3e2073d7231
Chris Desirauthored and Patrick Rohrcommited 2025-03-26 15:51:04 -07:00
Revert submission 3538339
Reason for revert: Likely culprit for b/406432012 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.
Reverted changes: /q/submissionid:3538339
Change-Id: I61b02f2b1b667e9a41b677f8062e8e96aac09f6e
QUIC stack running on the app process will call this API and register
QUIC UDP socket and UDP payload that can close QUIC connection.
When the app loses network access (e.g. due to freezer or firewall
chain), ConnectivityService 1)destroys the registered UDP socket by
sending a SOCK_DESTROY netlink message and 2)sends the registered UDP
payload to the server. This prevents unnecessary modem wakeups caused
by packets from the server after the apps lose network access.
Additionally, to close QUIC connection for apps that crash or are
killed, ConnectivityService sends the registered UDP payload when it
receives a socket destroy diag message for the registered socket.
Bug: 311792075
Test: CSDestroySocketTest CtsNetTestCases
Change-Id: I6cd727bd8bb0fe1d17360edfa395f73d24da6920
* changes:
Move isAtLeastB to dependencies
Pass nullable values to parse functions
Rename EthernetTrackerConfig to EthernetConfigParser
Do not support configuring test interfaces in config.xml
Prevent mixing mutable and immutable lists
Maciej Żenczykowskiauthored and Gerrit Code Reviewcommited 2025-03-21 16:08:07 -07:00
Instead of using an empty string, make the use of default capabilities
explicit by requiring "*" to be specified.
This behavior is more consistent and allows OEMs to explicitly configure
an interface without any capabilities (apart from those which are
hard-coded). (Technically, they could do so by specifying one of the
hardcoded capabilities in the config).
Test: TH
Change-Id: I1d25e5c4b302b0dbde5e1bb91fc1ed5a7b08be9d
Previously, this code path was hard to follow. EthernetConfigParser
parsed the capabilities specified in the xml, while
createDefaultNetworkCapabilities and / or createNetworkCapabilities
added additional capabilities to those specified in the xml.
This change moves the creation of the final NetworkCapabilities for
configured interfaces inside EthernetConfigParser to make it easier to
follow.
Test: TH
Change-Id: I367f53774eeee5aeca0fa7071db0403a6ce8bac5
* changes:
Move capability parsing to EthernetTrackerConfig
Move transport parsing to EthernetTrackerConfig
Delete unnecessary createEthernetTrackerConfig function
Patrick Rohrauthored and Gerrit Code Reviewcommited 2025-03-21 09:37:31 -07:00
Currently, apps targeting V can see thread local network.
This change introduces a mechanism to make existing
apps unable to see non-thread local networks to ensure minimal
impact on existing devices and applications while adopting this
behavior. Apps targeting B+ Sdk and run on V+ devices can see
non-thread local networks.
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.CSLocalAgentTests \
--update-device
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server --update-device
(on next/trunk_staging release config)
Bug: 349487600
Change-Id: I6aa43cebc20a9017c2d8a8a90ebb1d53040a27bb
...and if the feature is not killed.
For devices on V and below, this feature should be subject
to a rollout. That rollout should be done in mainline beta
if possible at all, meaning the flags can be defined later.
If beta isn't possible after all, a legacy rollout can happen
starting in M2025-06 too.
Test: manual
Change-Id: I941762bf759ce25b4bd1f908e971ceaf4f49f671
This is necessary to pass tests whatever the values of the features are.
NetworkAgentTest was updated assuming the feature was true, so
this patch revives the old code for when it's false.
TestableNetworkAgent reads the feature directly from
ConnectivityManager when it's not mocked.
Test: CtsNetTestCases
Change-Id: Ia556fbb1d1b6a38a4995b021981e2693d778bfff