Use resolveInstanceName in NsdService
For resolve requests, specify the resolveInstanceName in MdnsSearchOptions. This will cause discovery to send followup queries when TXT/SRV/A/AAAA records are missing; for example if only a PTR record is returned following the discovery probes, or if no discovery probe is sent at all. Test: atest NsdServiceTest Bug: 267570781 Change-Id: Ib18c3afbd1533ada7a78dd8ccac993adb439d014
This commit is contained in:
@@ -981,7 +981,9 @@ public class NsdServiceTest {
|
||||
waitForIdle();
|
||||
verify(mSocketProvider).startMonitoringSockets();
|
||||
verify(mDiscoveryManager).registerListener(eq(constructedServiceType),
|
||||
listenerCaptor.capture(), argThat(options -> network.equals(options.getNetwork())));
|
||||
listenerCaptor.capture(), argThat(options ->
|
||||
network.equals(options.getNetwork())
|
||||
&& SERVICE_NAME.equals(options.getResolveInstanceName())));
|
||||
|
||||
final MdnsServiceBrowserListener listener = listenerCaptor.getValue();
|
||||
final MdnsServiceInfo mdnsServiceInfo = new MdnsServiceInfo(
|
||||
|
||||
Reference in New Issue
Block a user