[mdns] add support for advertising subtypes
This commit adds support of advertising and discovering services
with subtypes.
With this change, client can publish a new service with subtypes with
code:
```
NsdServiceInfo info = new NsdServiceInfo();
info.setServiceName("My Service");
info.setServiceType("_meshcop._udp");
info.setSubtypes(Set.of("_abc"));
nsdManager.registerService(info, PROTOCOL_DNS_SD, listener);
```
Bug: 265095929
Test: atest CtsNetTestCases FrameworksNetTests
Change-Id: Ia83182e2d43002243d1ef4357d14a8056d7da14b
diff --git a/framework-t/api/current.txt b/framework-t/api/current.txt
index 86745d4..bbf5181 100644
--- a/framework-t/api/current.txt
+++ b/framework-t/api/current.txt
@@ -251,6 +251,7 @@
method public int getPort();
method public String getServiceName();
method public String getServiceType();
+ method @FlaggedApi("com.android.net.flags.nsd_subtypes_support_enabled") @NonNull public java.util.Set<java.lang.String> getSubtypes();
method public void removeAttribute(String);
method public void setAttribute(String, String);
method @Deprecated public void setHost(java.net.InetAddress);
@@ -259,6 +260,7 @@
method public void setPort(int);
method public void setServiceName(String);
method public void setServiceType(String);
+ method @FlaggedApi("com.android.net.flags.nsd_subtypes_support_enabled") public void setSubtypes(@NonNull java.util.Set<java.lang.String>);
method public void writeToParcel(android.os.Parcel, int);
field @NonNull public static final android.os.Parcelable.Creator<android.net.nsd.NsdServiceInfo> CREATOR;
}