Existing MdnsRecordRepositiry#getReply will send a NSEC RR in the reply
when 1) a query for a unique RR is not found or 2) any unique name which is
included in the answer sections. The second one is not aligned with the
spec:
```
On receipt of a question for a particular name, rrtype, and rrclass,
for which a responder does have one or more unique answers, the
responder MAY also include an NSEC record in the Additional Record
Section indicating the nonexistence of other rrtypes for that name
and rrclass.
```
This commit fixes the issue in 2) by checking that all unique records of
the name are included in the answers before adding a NSEC record.
Bug: 265095929
Test: atest FrameworksNetTests
Change-Id: I0531fbccf98e69a50bb8a45e529caaed3ad80b59
FastDataInput for reading persistent data is currently disabled
by default. This functionality will be gradually enabled through
A/B experiments to assess its impact.
One-shot boot time increase up to 10 second is one expected
outcome in worst case. Currently, the persistent data was loaded
when the first caller query it, but in this change it will be
done twice in the boot stage due to the needs of doing comparison.
Test: adb shell dumpsys netstats
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.net.NetworkStatsServiceTest
Test: manual test against data points under benchmark/assets/dataset
Bug: 313841499
Change-Id: Ia927bd115de5453ca3ee22104f3efbf44a55c2b8
This commit optimizes the mechanism to examine the TCP sockets
based on the VPN UID range.
The automaticOnOffKeepalives will be paused/resumed by checking
the TCP sockets status on the VPN network. The existing design
considers all UIDs, not the UID ranges for the specific VPN
network. This may lead to an inaccurate judgement to not to
stop the keepalive even when there is no socket on the VPN
network.
This commit is also a part of follow-up work from aosp/2354202
to use structized class to parse the TCP sockets.
Bug: 311119352
Bug: 265877161
Test: atest FrameworksNetTests
Change-Id: I4a6b751cb904b9c18ed1df420cc880ea38022d6a
Currently, the MdnsReplySender doesn't have a dedicated test
class to verify its functionality. To address this gap, add the
MdnsReplySenderTest class, which can test all methods within the
MdnsReplySender class.
Bug: 312657709
Test: atest FrameworksNetTests
Change-Id: Ibd948d97d38c012c63092ed4c6877d04b1ff14c1
Existing MdnsRecordRepositiry#getReply will result in duplicated RRs in
answer and additional records sections if multiple PTR questions for the
same service are received in a single query message.
This commit fixes this by using a Set<> for maintaining the RR set and
moving the NSEC construction to outer of the addReplyFromService() after
all answer and additional records have been added.
This commit also refactors the unit tests to cover more cases of
multiple queries other than PTR records
Bug: 265095929
Change-Id: I379dd89703915406c5700ed19aad46ef4035b917
This is a no-op refactoring that make a subclass of
NetworkStatsService#Dependencies in order to make the
follow-up changes can implement private getters in the
class and easier to review.
Test: TH
Bug: 313841499
Change-Id: If0de525b32abb9ad715c633f42b3c65c0d720d24
This increased reading performance by 35% while running
benchmark tests. But the feature is not enabled in the production
code until the service turns it on.
Test: atest ConnectivityBenchmarkTests
Test: atest ConnectivityCoverageTests:android.net.connectivity.android.net.NetworkStatsCollectionTest
Bug: 313841499
Change-Id: Ic827e6c4848cc31d46d62aa93993b483114a1f12
Allow client to register multi-subtype using comma separate format like:
"_997._tcp,_test1,_test2,_test3"
Bug: 315085895
Test: TH
Change-Id: Ibd27e42cb9e7a0274d1d8df3f6f3a00786e4a237
Support the RFC 6762 section 7.1. Known-Answer Suppression.
If the response contains an answer that is also present in the
answer section and the known-answer's TTL is greater than half
of the original TTL, suppress the response.
Bug: 312657709
Test: atest FrameworksNetTests NsdManagerTest
Passed DUPLICAE SUPPRESSION test case of BCT
Change-Id: I1890e9fba068c1f59a1d93c3514f0e7d07da1814
This is the servide-side impl of the subtypes advertising added in
aosp/2608627. See that CL for more backgrounds.
Bug: 265095929
Test: atest CtsNetTestCases FrameworksNetTests
Change-Id: I3d6f96822ac89d12fe29c00f688d848297c25787
This causes the module to crash on rollback because the current
production code does not consider LOCAL_NETWORK to be a valid
capability.
Change-Id: Idf57d72c384b41b483098c4c302738072ebf7f90
Test: TH
Fix: 313030307
Lorenzo Colittiauthored and Remi NGUYEN VANcommited 2023-12-13 11:24:25 +09:00
The verification happened earlier than the interaction with
production code. This may happen in low performance devices,
e.g. cuttlefish. Add timeout for the verification to deflake
the test.
Bug: 313828402
Test: atest FrameworksNetTests
Change-Id: I1ffa7e7573d503eb0396aa211a90ba032175b3a1
BYPASS_INCLUSIVE_LANGUAGE_REASON=Using public API
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.CSBpfNetMapsTest
(on U and V devices respectively)
Bug: 297836825
Fix: 314858283
Change-Id: Ibeac8cd3a33468c6539234255328affc6b3f8ffe
This is a test only change, replacing the MdnsPointerRecord
constructor usage for queries with the new version.
Bug: 312657709
Test: atest FrameworksNetTests
Change-Id: Ie9e51df78bfc27090503b861c5ac979201f10608
The current implementation of MdnsAdvertiser doesn't support updating an
existing registration. For an update request, the client needs to
unregister it first, which will trigger an exit message and then
register again, which will trigger an announcement message. There are
some clients that don't want to trigger the exit and announcement
message every time. This CL adds the API to support that use case.
Bug: 309372239
Test: TH
Change-Id: Iabe69a987a11104090082e01969e7595f05504e8
Check if the bpf loader rc file is differs from the template files when
ConnectivityService starts. Use Log.wtf() to log the file if there is a
diff.
Bug: 312638861
Test: TH
Change-Id: I0b9ed9962ad0954a051a17b01357d04a0e655ff4
Update registerOffloadEngine() permission check to check the
DEVICE_POWER permission in U. This change is required to allow the
android TV device to access the API in U because the
REGISTER_NSD_OFFLOAD_ENGINE permission can not be backported.
Bug: 313546516
Test: TH
Change-Id: I84b80d102a34487ad54719a86eb525b319e2fd8b
In PrivateDnsConfig class, `useTls` is replaced with `mode`.
This CL a corresponding change.
Bug: 240259333
Test: atest ConnectivityCoverageTests
Change-Id: I60c53e52f287fc7fa05543603a62632d934bb2e6
Vpn.Dependencies contains methods used for legacy VPNs that are
now unused. Remove them.
Bug: 161776767
Test: atest FrameworksNetTests
Change-Id: I68bbb3e519f5558f9006f680df79ae8073e196cd
On mobile networks it is more likely that the user needs to top up or
get a mobile data subscription, rather than "sign in" as the previous
messaging was suggesting.
Following feedback from interaction designers / UX writers, change the
strings to be more appropriate for the most common use-case.
Bug: 153673376
Test: atest FrameworksNetTests
manual test on mobile network force-detecting a portal.
Change-Id: I5b4d4a17fd507d8cf3c9863cf23b5fedb258852e