As per RFC 1034/1035, the max size of the label is 63 bytes. It should
also be guaranteed when the serviceName is renamed due to the conflict.
Bug: 265865456
Test: atest FrameworksNetTests
Change-Id: I077d8abdb91071db62b9618d9918e3a12682aaf4
From service-connectivity, NAMESPACE_TETHERING must be used, as
NAMESPACE_CONNECTIVITY is used for the NetworkStack module. Also the
isFeatureEnabled with module name must be used, otherwise the "android"
package version is queried instead of the tethering module version.
BpfNetMaps is using flag value 1 to workaround this issue.
flags in NsdService, AutomaticOnOffKeepaliveTracker, and ConnectivityFlags
were not pushed currently.
So, this change has no effect to devices.
Bug: 279108992
Test: TH
Change-Id: I2b4b6a13c048c20beef52b1f43b9e21aca0c637a
The ConnectivityResources class is only usable with QUERY_ALL_PACKAGES
permission, so it is not generally usable in framework-connectivity. It
is also backed by the ServiceConnectivityResources APK, which is
intended as resources for service-connectivity.
Move the class to service-connectivity and update callers. CTS needs a
way to determine the supported keepalive count as it used the
resources from KeepaliveUtils as @hide API, so provide a
ConnectivityManager @hide API for testing.
Bug: 279108992
Test: atest
Change-Id: I3c9a77c580b5ab87c922c32778bce15dc33b4d1d
Cellular networks are now supported for marking wakeup packets. As a
result onWakeupEvent now also reports data relevant to the cell
transport.
These unit tests should add coverage for these new behaviors.
Test: atest FrameworksNetTests
Bug: 276498460
Change-Id: I0b8a03fff6255e067b736f3dbfb53de56420f90b
Currently, the mDns discovery services will clear if no listener
registers to that MdnsServiceTypeClient. If an app does discover,
stop discover, resolve, at this point the listener was
unregistered, so the MdnsServiceTypeClient was deleted, and the
service is gone from cache. So this will actually restart
discovery without returning previous results from cache. Thus,
add MdnsServiceCache to store all services and reduce the
duplicated queries.
Bug: 265787401
Test: atest FrameworksNetTests
Change-Id: If3d4eb4e3dc5455f6f97cb782aa1b99b2a00f6e0
Currently, the MTU tests work on networks that have not yet been
connected. This is not very realistic because most MTU changes
(like most LinkProperties changes in general) happen after the
network has connected. Change these tests to use connected
networks instead.
To avoid losing coverage for setting the MTU before the network
is connected, add a test just for that.
Bug: 143158421
Test: test-only change
Change-Id: I7f808249722924a0b1253e402c5580bb104afd8e
Phenotype is updating the flags while this test is running
and this DoS'es the device to such an extent that the test
process doesn't get the CPU for more that 300ms. That lets
the lingering timeout run its course and fails the test.
This won't necessarily fix all flakes (after all, if
Phenotype hogs the CPU for 2 seconds the same issue will
continue to happen), but it should help.
Bug: 277555492
Test: FrameworksNetTests
Change-Id: I78ab1573974427b10dd557c011fbbf64942fd09f
* changes:
Revert^2 "Put client logs into SharedLog and dump more logs"
Revert^2 "Record Advertiser history logs for better debugging"
Revert "Revert "Record SocketProvider history logs for better de..."
Revert "Revert "Record DiscoveryManager history logs for better ..."
The setup for the mocking object will be reset when each test
finishs the test. Reset the mocking value is actually no-op
but cause possible threading issue in Mokito.
Bug: 278979735
Test: atest com.android.server.connectivity.VpnTest \
--rerun-until-failure 100
Change-Id: Ib8c3813e5dbcc9b7432a5548766d63e400b4ed0e
Netd is not updatable since it's not mainlined.
To make socket destroy code updatable, the code was re-implemented in
java and moved to Connectivity.
Bug: 270298713
Test: atest FrameworksNetTests
Change-Id: I5439c0c76c42a9f738a1b25a1f62e701755cbd05
Revert submission 2542434-revert-2535219-TAMNEZLAHT
Reason for revert: Prepare a fix for the original topic
Reverted changes: /q/submissionid:2542434-revert-2535219-TAMNEZLAHT
Change-Id: I718418e4499784255b177622e3c08a82d0b24640
* changes:
Revert "Record DiscoveryManager history logs for better debugging"
Revert "Record SocketProvider history logs for better debugging"
Revert "Record Advertiser history logs for better debugging"
Revert "Put client logs into SharedLog and dump more logs"
* changes:
Put client logs into SharedLog and dump more logs
Record Advertiser history logs for better debugging
Record SocketProvider history logs for better debugging
Record DiscoveryManager history logs for better debugging
Resolve callbacks should only be sent for the service name that was
requested.
Bug: 267570781
Test: atest MdnsServiceTypeClientTests
Change-Id: I3d8eb5c06bcf54312e20a39b8575555d40528bca
This also updates the tests and prepares them to assert the other fields
of DailyKeepaliveInfoReported. Currently, only DurationPerNumOfKeepalive
is asserted.
Bug: 273451360
Test: atest FrameworksNetTests
Change-Id: I727849fa8a08d66fe276909b353a75861c23d775
Create a new class to store duration metrics of AutomaticOnOffKeepalives
for the DurationPerNumOfKeepalive proto.
This tracks the duration of time that the AutomaticOnOffKeepaliveTracker
contains a given number of concurrent keepalives and the duration of
time that it contains a given number of active concurrent keepalives.
Bug: 273451360
Test: atest FrameworksNetTests
Change-Id: If31ccbc7b02e6ad3ff1646e92e55ca7c8662e47c
Log:
2023-04-12T20:00:18.100961 - Removing service with ID 2
2023-04-12T20:00:17.173904 - [wlan0] Probing finished for service 2
2023-04-12T20:00:17.147089 - [testtap1] Probing finished for service 2
2023-04-12T20:00:17.074575 - [testtap0] Probing finished for service 2
2023-04-12T20:00:16.249636 - Adding service name: ^Nsd.Test|Non-#AsCiI\Characters&\ufffe テスト 測試, type: _nmt950580894._tcp, hostAddresses: , port: 12345, network: null, txtRecord: with ID 2
Test: atest FrameworksNetTests android.net.cts.NsdManagerTest
Bug: 275004614
Change-Id: I22577615b0b2c212c0a4349a06ef3c75239a5651
MdnsSocketProvider currently does not fill addresses of downstream
tethering interfaces in its callbacks. The interface addresses should be
properly updated by listening to the Netlink messages.
Test: atest FrameworksNetTests CtsNetTestCases
Bug: 267980538
Change-Id: I753e547a1b092703fe59c6c9e922ee8aca245f67
This is a clean up commit to correct the javadoc of
NetworkAgent.CMD_START_SOCKET_KEEPALIVE. This event was used
between ConnectivityService/NetworkAgent, and also
ConnectivityService/KeepaliveTracker with different semantics.
This may confuse the developers to update the doc incorrectly,
so also separate the usage to different events.
Also move the event definitions together so that a new event
definition will not mis-use the existing values.
Test: atest FrameworksNetTests
Change-Id: I73ebd8abcc610531da3057da2d643a41befb2099
This patch only adjusts the existing tests for the change
in the companion patch. Actual tests will come as a followup
because this patch is already big enough.
Test: VpnTest
Bug: 269715746
Change-Id: I65542a8f4151b4857f1b3758b2cae887bfbfe261