Network state is not changed to disconnected when a networkagent
is disconnected and network state is SUSPENDED.
So the function requiresClat return true. Clat is not stoped.
Bug: 277682237
Test: atest FrameworksNetTests
Change-Id: I5edfcf64aca5d2d34325d722dd29fab41bcf2600
MdnsDiscoveryManager should use the same thread that create on
NsdService that is used on other mDns components. Thus, pass that
thread loop to MdnsDiscoveryManager.
Bug: 265787401
Test: atest FrameworksNetTests
Change-Id: Icc23994c3ebc99da6043ed2d93540c44f53a150b
ServiceTypeClients will store/access services on MdnsServiceCache
in subsequent changes. And MdnsServiceCache can be accessed from
looper thread only. So ensure MdnsDiscoveryManager calls to
ServiceTypeClients on the looper thread.
Bug: 265787401
Test: atest FrameworksNetTests
Change-Id: I05e73140da58c029b49057bb0ccfdb8ed7818dfc
Use the new ConnectivityTestTargetPreparer name instead, as the preparer
is being made more generic.
Bug: 263665773
Test: m
Merged-In: I520e92c449f366c51cda2f8b33fe9a354a8c0445
Change-Id: I520e92c449f366c51cda2f8b33fe9a354a8c0445
Use the new ConnectivityTestTargetPreparer name instead, as the preparer
is being made more generic.
Bug: 263665773
Test: m
Ignore-AOSP-First: In a topic with internal-only repo. Will cherry-pick
to AOSP immediately afterwards.
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:22e7c25731e6e655a7b86c3b6e4e302cf7111a60)
Merged-In: I520e92c449f366c51cda2f8b33fe9a354a8c0445
Change-Id: I520e92c449f366c51cda2f8b33fe9a354a8c0445
MdnsServiceTypeClient should stop sending when it is removed due to its
socket being destroyed.
On null networks (downstream interfaces) that may have multiple sockets,
this should only happen once the last socket used by the (null) network
has been destroyed.
Bug: 278635632
Test: atest
(cherry picked from https://android-review.googlesource.com/q/commit:3d66b0432d0f83249d18ffaa757103129359d115)
Merged-In: Ie1808840bd68678f2af7b71bdd8f3be377c14424
Change-Id: Ie1808840bd68678f2af7b71bdd8f3be377c14424
When a SocketCallback is unregistered from MdnsSocketProvider, do not
send socket destroyed callbacks. Callers may not expect getting
callbacks after unregistration, and the current callbacks are also
broken when an unrequested socket is still in use by another requester.
MdnsAdvertiser already does not depend on getting this callback, as it
only unregisters the SocketCallback after it is done using the socket.
This change fixes MdnsMultinetworkSocketClient to destroy the socket by
itself when unrequesting.
Bug: 276177548
Test: atest
(cherry picked from https://android-review.googlesource.com/q/commit:5fe9bacc63c1b6a77878f23d5f53a07fc482f354)
Merged-In: If95f833e293f3aab91128aab1c9852ebfd41995d
Change-Id: If95f833e293f3aab91128aab1c9852ebfd41995d
Currently, clatd is not stopped when suspended network is disconnected
and aosp/2583410 fixes this issue.
This CL adds test for current behavior, aosp/2583410 can update
testDisconnectSuspendedNetworkStopClatd to call verifyClatdStop instead
of verifyNeverClatdStop
Test: atest FrameworksNetTests
Bug: 277682237
Change-Id: I345e097ce8e114800d77c5f44d38d7ae4938935c
mDNS is supposed to be case-insensitive (like DNS). Both advertising and
discovery logic should use case-insensitive matching instead of
case-sensitive matching.
The case sensitive matching can be found by grepping the String.equals()
and Arrays.equals() check across the whole code base. Each occurrence is
analyzed carefully to list up all necessary fixes.
Bug: 272194544
Test: atest FrameworksNetTests
Change-Id: I7c10878129663549c9171c1420b6f399930df2cb
MdnsServiceTypeClient should stop sending when it is removed due to its
socket being destroyed.
On null networks (downstream interfaces) that may have multiple sockets,
this should only happen once the last socket used by the (null) network
has been destroyed.
Bug: 278635632
Test: atest
Change-Id: Ie1808840bd68678f2af7b71bdd8f3be377c14424
When a SocketCallback is unregistered from MdnsSocketProvider, do not
send socket destroyed callbacks. Callers may not expect getting
callbacks after unregistration, and the current callbacks are also
broken when an unrequested socket is still in use by another requester.
MdnsAdvertiser already does not depend on getting this callback, as it
only unregisters the SocketCallback after it is done using the socket.
This change fixes MdnsMultinetworkSocketClient to destroy the socket by
itself when unrequesting.
Bug: 276177548
Test: atest
Change-Id: If95f833e293f3aab91128aab1c9852ebfd41995d
Implement subtype advertising by advertising an additional PTR record if
subtype advertising was requested.
For an advertiser a subtype is just an additional PTR record, so this
just involves plumbing the subtype down to MdnsRecordRepository, which
includes the additional record in the service registration.
Bug: 266167702
Test: atest
(cherry picked from https://android-review.googlesource.com/q/commit:ce44beb7aa3d17dabab5e596a1b27cb9422e076e)
Merged-In: I09e780af25149162f16bd75410ddc50f160a0dab
Change-Id: I09e780af25149162f16bd75410ddc50f160a0dab
Apps may want to discover a particular subtype, such as
_color._sub._printer._tcp.local, which may return services like
Printer1._printer._tcp.local. The previous code was trying to discover,
and would return service types named _color._sub._printer._tcp.local,
even though the actual service type is still _printer._tcp.local. This
is a regression compared to S/T.
Fix this by passing the subtype to MdnsDiscoveryManager in its options
instead of the service type, and ensure that MdnsDiscoveryManager only
sends callbacks to callers that have requested the given subtype (a
color that asked for _color._sub._printer._tcp.local should not receive
BlackAndWhite._printer._tcp.local).
Bug: 266167702
Test: atest
(cherry picked from https://android-review.googlesource.com/q/commit:f2d064112c34eb703dabdd5a48008ba4b3183a0b)
Merged-In: I21367c66534078667718a9b54dfc858b12ba7103
Change-Id: I21367c66534078667718a9b54dfc858b12ba7103
The ServiceTypeClient should be removed after socket destroyed
because it's no longer used by any request. The requests will be
matched to the newly created ServiceTypeClient.
Bug: 278635632
Test: atest FrameworksNetTests CtsNetTestCases
(cherry picked from https://android-review.googlesource.com/q/commit:f2a51ac5f8cc6b1cfaaa0f8fd5c28af522806ca0)
Merged-In: Ia917b14d3666f3bfe8e874606a34800a4ce65c5a
Change-Id: Ia917b14d3666f3bfe8e874606a34800a4ce65c5a
If a listener request is fulfilled immediately from cache, do not
restart queries immediately, but just schedule the next run.
This avoids doubling the number of queries when discovery, then resolve
is requested.
Bug: 281793453
Test: atest
(cherry picked from https://android-review.googlesource.com/q/commit:58bb0a129a4eb1f19904265104af2a14db248cb3)
Merged-In: Ibe41ee20427068a1ccdbc1f04525988a89a58899
Change-Id: Ibe41ee20427068a1ccdbc1f04525988a89a58899