This commit makes the NsdManager.registerService() API public. This
change will enable developers to implement more customizable mDNS
advertising behavior in their applications.
Bug: 373270045
Test: atest CtsNetTestCases:NsdManagerTest
Flag: com.android.net.flags.mdns_advertising_improvement
API-Coverage-Bug: 415202964
Change-Id: I32359f7265b3597defd57123ecff0deaef0011f8
The flag, used in the newly exposed AdvertisingRequest, allows
skipping the probing step when the service name is known to be unique
already.
This allows implementing RFC 6762 section 8.1 that specifies probing
SHOULD be skipped if it is known via other means that the record set
is unique.
Bug: 384841047
Test: atest CtsNetTestCases:NsdManagerTest
Change-Id: I19d67ff2863af631bd9c2f518b004f1688ac5f87
This allows obtaining the hostname that is pointing to the address
records, which were already available though #getHostAddresses.
This is covered by existing CTS tests, for example the
servicesWithCustomHost_customHostAddressesFound test in NsdManagerTest.
Test: atest CtsNetTestCases:NsdManagerTest
API-Coverage-Bug: 384841047
Change-Id: Ib939c1977a76d8d98c9b4f79da6a1a6b0acf6a87
Rename API methods and update API docs as per API
council feedbacks
Bug: 316603231
Test: make update-api && make
Change-Id: Ibb1f58792d2e40ef1084c2b532e999a516a87b37
This commit adds support of discovering services with explicit subtype.
With this change, a service can be discovered with subtype with:
```
nsdManager.discoverServices(
new DiscoveryRequest.Builder("_http._tcp", PROTOCOL_DNS_SD)
.setSubtype("_printer").build(),
executor, listener);
```
Bug: 265095929
Test: atest CtsNetTestCases FrameworksNetTests
Change-Id: Iba76283a003cf2d52a8c26e1de872c3e8e433350
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
This change adds overriding methods that are essential to compile the
stubs generated from the signature files.
More information and the background for this change is available at
go/add-overriding-one-pager.
Test: m checkapi
Bug: 299366704
Change-Id: Idba307148fd9afa87bfb7e0c89e00d9bd97ec204
Currently, metalava will discard concrete overrides of abstract methods
from the API signature files which causes problems when attempting to
generate stubs from those files and also discards information that may
be important in API reviews. This change is the first step in the
process of changing that behavior.
This change hard codes the current behavior for discarding the concrete
overrides (`add-additional-overrides=no`) into those signature files
that will (or are likely) to be affected by the change in behavior.
That allows the default behavior to be changed for all the other files
without affecting these.
Follow up changes will remove the hard coding from the signature files
and will update the contents which will include the concrete overrides
of the abstract methods.
More information and the background for this change is available at
go/add-overriding-one-pager.
Test: m checkapi
Bug: 299366704
Change-Id: I52c5bbe2e3bbd36019fe44fcb0b2d19876a5a869
Rename the method onResolveStopped(NsdServiceInfo) to
onResolutionStopped(NsdServiceInfo) for consistency as API
review feedback.
Bug: 266811051
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: I788b5903ecaf78a9aa960dd3b7413a22f171c72f
Currently, the resolution is a one shot query, it only notifies
the first finding service information. There is no way to listen
the service update. Thus, add a new API that can register a
callback to listen to the service updates continuously.
Bug: 245369943
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: I0e9d92b9028375feb3e344ab6c4acb515c5b2be9
Paul Huauthored and Remi NGUYEN VANcommited 2023-01-19 20:16:03 +09:00
Resolve service may take long time due to network issue or
using wrong service information, but users are not able to stop
it. They can only wait for the callback of resolveService to end,
which sometimes takes a long time. Thus, add the new API that
users can stop the service resolution.
Bug: 245369943
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: I6b6183c8c73f8db981b9afa51fbc73bf886d9ed3
Add executors to APIs added in T, and overloads with Executors for
consistency to register/resolve.
Bug: 218752665
Test: atest NsdManagerTest
Change-Id: I9d89ea8352aa8274a90bf6cb273d5b45828f53cc
This CL builds NetworkStats related codes with the
connectivity module instead of platform.
Test: TH
Bug: 197717846
Change-Id: I4eeb7ea9cfc3139991caf0fc22474e0052a0391c
Merged-In: I4eeb7ea9cfc3139991caf0fc22474e0052a0391c
Verify that services will be found / lost when underlying networks
change.
Bug: 190249673
Test: atest NsdManagerTest
Change-Id: If62b18a729c6d7b8e2c8701eda6f860ecea4cbaf
Test that NsdManager specifies the correct network when a service is
discovered, and that services can be resolved on a specified network.
Also test that service discovery can be started on a specific network.
Bug: 190249673
Test: atest NsdManagerTest
Change-Id: Ie8b551ce9e33e3adf35f75508f91bbd0df71f837