Merge "Importing the following changes from gmscore"

This commit is contained in:
Yuyang Huang
2023-06-14 05:33:22 +00:00
committed by Gerrit Code Review
3 changed files with 5 additions and 0 deletions

View File

@@ -42,6 +42,9 @@ public class ExecutorProvider {
/** Shuts down all the created {@link ScheduledExecutorService} instances. */
public void shutdownAll() {
for (ScheduledExecutorService executor : serviceTypeClientSchedulerExecutors) {
if (executor.isShutdown()) {
continue;
}
executor.shutdownNow();
}
}

View File

@@ -238,6 +238,7 @@ public class MdnsDiscoveryManager implements MdnsSocketClientBase.Callback {
}
if (perNetworkServiceTypeClients.isEmpty()) {
// No discovery request. Stops the socket client.
sharedLog.i("All service type listeners unregistered; stopping discovery");
socketClient.stopDiscovery();
}
}

View File

@@ -332,6 +332,7 @@ public class MdnsServiceTypeClient {
private void onResponseModified(@NonNull MdnsResponse response) {
final String serviceInstanceName = response.getServiceInstanceName();
sharedLog.i("Handling response from service: " + serviceInstanceName);
final MdnsResponse currentResponse =
instanceNameToResponse.get(serviceInstanceName);