Add test for downstream tethering

Add end-to-end testing for testing NsdManager advertising and
discovering works fine with downstream tethering interfaces.

Bug: 281639507
Test: atest NsdManagerTest
Change-Id: I5a66423f216cfe0c82db5128502c885980ab264b
This commit is contained in:
Yuyang Huang
2023-05-24 14:45:59 +09:00
parent a669de72d3
commit fca402abed
9 changed files with 485 additions and 278 deletions

View File

@@ -1677,7 +1677,10 @@ public class NsdService extends INsdManager.Stub {
mMdnsSocketProvider = deps.makeMdnsSocketProvider(ctx, handler.getLooper(),
LOGGER.forSubComponent("MdnsSocketProvider"), new SocketRequestMonitor());
// Netlink monitor starts on boot, and intentionally never stopped, to ensure that all
// address events are received.
// address events are received. When the netlink monitor starts, any IP addresses already
// on the interfaces will not be seen. In practice, the network will not connect at boot
// time As a result, all the netlink message should be observed if the netlink monitor
// starts here.
handler.post(mMdnsSocketProvider::startNetLinkMonitor);
// NsdService is started after ActivityManager (startOtherServices in SystemServer, vs.