Fix service resolve on tethering downstreams
Tethering downstreams do not have NetworkAgents, and although they have a netid of 99, Networks with netId 99 are not usable by apps for most connectivity APIs. Recent refactoring in NsdService adds the Network of a found service into its NsdServiceInfo, and uses that network to resolve the service. In that case the Network has netId 99 and resolving the service fails. Avoid that problem by: - Keeping the Network field null when a service is found on a tethering downstream; this avoids giving apps a confusing and unusable Network with netId 99 - Using the interface index found during discovery to resolve the service, if the app uses the NsdServiceInfo that was obtained from discovery to resolve. If not, all interfaces will be used to resolve, as per legacy APIs. Bug: 233979892 Test: atest NsdServiceTest Also manual test with 2 devices connected via hotspot Change-Id: Idd176153b67ccbd1d4f1b1fd66dafaa2f3a9e27a (cherry picked from commit 1a8ee102) Merged-In: Idd176153b67ccbd1d4f1b1fd66dafaa2f3a9e27a
Loading
Please register or sign in to comment