Implement proper subtype advertising

Implement subtype advertising by advertising an additional PTR record if
subtype advertising was requested.

For an advertiser a subtype is just an additional PTR record, so this
just involves plumbing the subtype down to MdnsRecordRepository, which
includes the additional record in the service registration.

Bug: 266167702
Test: atest
Change-Id: I09e780af25149162f16bd75410ddc50f160a0dab
This commit is contained in:
Remi NGUYEN VAN
2023-05-11 20:42:26 +09:00
parent f2d064112c
commit ce44beb7aa
8 changed files with 183 additions and 71 deletions

View File

@@ -727,7 +727,7 @@ public class NsdService extends INsdManager.Stub {
// service type would generate service instance names like
// Name._subtype._sub._type._tcp, which is incorrect
// (it should be Name._type._tcp).
mAdvertiser.addService(id, serviceInfo);
mAdvertiser.addService(id, serviceInfo, typeSubtype.second);
storeAdvertiserRequestMap(clientId, id, clientInfo);
} else {
maybeStartDaemon();