Fill in all resolved addresses into NsdServiceInfo
Now, the multiple addresses is supported in resolution service with the new java backend. Thus, fill in all resolved addresses into NsdServiceInfo. Bug: 268586836 Test: atest FrameworksNetTests Change-Id: I499a749255429df9fe9fbad678074ad383159240
This commit is contained in:
@@ -994,7 +994,7 @@ public class NsdServiceTest {
|
||||
new String[]{"android", "local"}, /* hostName */
|
||||
PORT,
|
||||
List.of(IPV4_ADDRESS),
|
||||
List.of(IPV6_ADDRESS),
|
||||
List.of("2001:db8::1", "2001:db8::2"),
|
||||
List.of() /* textStrings */,
|
||||
List.of(MdnsServiceInfo.TextEntry.fromBytes(new byte[]{
|
||||
'k', 'e', 'y', '=', (byte) 0xFF, (byte) 0xFE})) /* textEntries */,
|
||||
@@ -1014,6 +1014,11 @@ public class NsdServiceTest {
|
||||
assertEquals(1, info.getAttributes().size());
|
||||
assertArrayEquals(new byte[]{(byte) 0xFF, (byte) 0xFE}, info.getAttributes().get("key"));
|
||||
assertEquals(parseNumericAddress(IPV4_ADDRESS), info.getHost());
|
||||
assertEquals(3, info.getHostAddresses().size());
|
||||
assertTrue(info.getHostAddresses().stream().anyMatch(
|
||||
address -> address.equals(parseNumericAddress("2001:db8::1"))));
|
||||
assertTrue(info.getHostAddresses().stream().anyMatch(
|
||||
address -> address.equals(parseNumericAddress("2001:db8::2"))));
|
||||
assertEquals(network, info.getNetwork());
|
||||
|
||||
// Verify the listener has been unregistered.
|
||||
|
||||
Reference in New Issue
Block a user