summaryrefslogtreecommitdiff
path: root/libs/androidfw/misc.cpp
diff options
context:
space:
mode:
author Luke Huang <huangluke@google.com> 2021-05-26 10:17:46 +0800
committer Luke Huang <huangluke@google.com> 2021-06-08 10:09:30 +0800
commitb4cbf81dd70d12dc1e6444b503e4d44d1e1b094d (patch)
tree964b39b32b5e4f00813bea3c54b58f379f91f584 /libs/androidfw/misc.cpp
parent9489b44d47372be1cd19dd0e5e8da61c25380de6 (diff)
Make NsdService only start the native daemon when needed and automatically clean it up.
Currently, NsdService starts the native mdnsresponder daemon if any NsdManager connect to it, which results in that when any constant service holds the NsdManager connection, the device would always be in the mdns multicast group whatever the connection is not used or not. This is because mdnsresponder will join the multicast group when it starts. To solve this problem, start the native daemon only when needed, and clean it up after the given idle timeout. 1. Start the native daemon when a new request come. 2. If there is no pending request, clean up the daemon after 3 seconds of idle time. Bug: 181810560 Test: atest NsdManagerTest NsdServiceTest Change-Id: I3eb04552f6cf6c0c68c07abffe751bb4d0669215
Diffstat (limited to 'libs/androidfw/misc.cpp')
0 files changed, 0 insertions, 0 deletions