Raise the max listener per client limit to 200

Raise the max listener per client limit from 10 to 200.

A frequent use-case for NsdManager is to file a DiscoveryListener,
and try to resolve/listen for every service using a ServiceInfoCallback.

The current limit of 10 callbacks is easy to hit in that case, since it
would happen if there are at least 10 devices on the network.

Raise the limit to 200 to avoid such problems. In practice it is very
unlikely that there would be more than 200 services on a network; if
advertised by different devices, they would barely fit in a /24 IPv4
prefix, so a limit of 200 should generally be high enough.

Note that for discovery 200 listeners does not mean that batches of 200
queries will be sent: listeners on the same service type are grouped
together so only one query is sent for the type, and results are
distributed to matching listeners.

Note also that the limit is currently only checked when registering
discovery or advertising requests. This should be also checked when
registering other kinds of listeners in a future change.

Bug: 324377460
Test: atest
Change-Id: I86fc00777e9dea3e5192b575581ba562e7401e42
diff --git a/service-t/src/com/android/server/NsdService.java b/service-t/src/com/android/server/NsdService.java
index edd4818..e26b650 100644
--- a/service-t/src/com/android/server/NsdService.java
+++ b/service-t/src/com/android/server/NsdService.java
@@ -2623,7 +2623,15 @@
     /* Information tracked per client */
     private class ClientInfo {
 
-        private static final int MAX_LIMIT = 10;
+        /**
+         * Maximum number of requests (callbacks) for a client.
+         *
+         * 200 listeners should be more than enough for most use-cases: even if a client tries to
+         * file callbacks for every service on a local network, there are generally much less than
+         * 200 devices on a local network (a /24 only allows 255 IPv4 devices), and while some
+         * devices may have multiple services, many devices do not advertise any.
+         */
+        private static final int MAX_LIMIT = 200;
         private final INsdManagerCallback mCb;
         /* Remembers a resolved service until getaddrinfo completes */
         private NsdServiceInfo mResolvedService;