Combine SparseArrays in ClientInfo
Instead of using three mClientIds, mClientRequests, mListeners
SparseArrays, use one array containing different subclasses of
ClientRequest.
This avoids having three arrays with mostly the same keys, and makes it
easier to differentiate requests for mdnsresponder, MdnsAdvertiser and
MdnsDiscoveryMaager.
It will also allow supporting having some requests using mdnsresponder,
and some other requests using MdnsAdvertiser or MdnsDiscoveryManager.
This is necessary to allow enabling/disabling the MdnsAdvertiser and
MdnsDiscoveryManager features without reboot.
There is a slight change in logging when DBG=true for ClientInfo:
Before:
Exceeded max outstanding requests mResolvedService null
mIsLegacy false
clientId 2 mDnsId 2 type 1
After:
Exceeded max outstanding requests mResolvedService null
mIsLegacy false
clientId 2 mDnsId 2 type NsdService$LegacyClientRequest
Bug: 265891278
Test: atest NsdServiceTest
Change-Id: Ibfb9bb5a61960ca635126b4a492fa0441484aa95
1 file changed