Skip to content
Commit 1c2be6b3 authored by Handa Wang's avatar Handa Wang
Browse files

[mdns] add API support for custom hostname

This commit adds support of regsitering a service with a custom
hostname. This is required to enable Advertising Proxy feature for Thread
devices.

For example:
```
NsdServiceInfo info = new NsdServiceInfo();

info.setServiceName("My Service");
info.setServiceType("_test._tcp");
info.setHostname("MyHost");
info.setHostAddresses(List.of(address1, address2));

nsdManager.registerService(info, PROTOCOL_DNS_SD, listener);
```

This CL also adds two new error codes for service/host registration
conflict: `FAILURE_SERVICE_NAME_CONFLICT` and
`FAILURE_HOST_NAME_CONFLICT`.

Bug: 284904661
Test: atest CtsNetTestCases FrameworksNetTests

Change-Id: I2fb974c38d851ba99144a18c7047084bbd61b938
parent ff474baf
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment