Merge "Include IPv6 DNS servers in wifi details" into oc-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
1b62d99433
@@ -431,9 +431,8 @@ public class WifiDetailPreferenceController extends AbstractPreferenceController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find IPv4 DNS addresses.
|
// Find all (IPv4 and IPv6) DNS addresses.
|
||||||
String dnsServers = mLinkProperties.getDnsServers().stream()
|
String dnsServers = mLinkProperties.getDnsServers().stream()
|
||||||
.filter(Inet4Address.class::isInstance)
|
|
||||||
.map(InetAddress::getHostAddress)
|
.map(InetAddress::getHostAddress)
|
||||||
.collect(Collectors.joining("\n"));
|
.collect(Collectors.joining("\n"));
|
||||||
|
|
||||||
|
@@ -437,10 +437,14 @@ public class WifiDetailPreferenceControllerTest {
|
|||||||
public void dnsServersPref_shouldHaveDetailTextSet() throws UnknownHostException {
|
public void dnsServersPref_shouldHaveDetailTextSet() throws UnknownHostException {
|
||||||
mLinkProperties.addDnsServer(InetAddress.getByAddress(new byte[]{8,8,4,4}));
|
mLinkProperties.addDnsServer(InetAddress.getByAddress(new byte[]{8,8,4,4}));
|
||||||
mLinkProperties.addDnsServer(InetAddress.getByAddress(new byte[]{8,8,8,8}));
|
mLinkProperties.addDnsServer(InetAddress.getByAddress(new byte[]{8,8,8,8}));
|
||||||
|
mLinkProperties.addDnsServer(Constants.IPV6_DNS);
|
||||||
|
|
||||||
displayAndResume();
|
displayAndResume();
|
||||||
|
|
||||||
verify(mockDnsPref).setDetailText("8.8.4.4\n8.8.8.8");
|
verify(mockDnsPref).setDetailText(
|
||||||
|
"8.8.4.4\n" +
|
||||||
|
"8.8.8.8\n" +
|
||||||
|
Constants.IPV6_DNS.getHostAddress());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -546,12 +550,14 @@ public class WifiDetailPreferenceControllerTest {
|
|||||||
|
|
||||||
lp.addDnsServer(Constants.IPV6_DNS);
|
lp.addDnsServer(Constants.IPV6_DNS);
|
||||||
updateLinkProperties(lp);
|
updateLinkProperties(lp);
|
||||||
inOrder.verify(mockDnsPref, never()).setVisible(true);
|
inOrder.verify(mockDnsPref).setDetailText(Constants.IPV6_DNS.getHostAddress());
|
||||||
|
inOrder.verify(mockDnsPref).setVisible(true);
|
||||||
|
|
||||||
lp.addDnsServer(Constants.IPV4_DNS1);
|
lp.addDnsServer(Constants.IPV4_DNS1);
|
||||||
lp.addDnsServer(Constants.IPV4_DNS2);
|
lp.addDnsServer(Constants.IPV4_DNS2);
|
||||||
updateLinkProperties(lp);
|
updateLinkProperties(lp);
|
||||||
inOrder.verify(mockDnsPref).setDetailText(
|
inOrder.verify(mockDnsPref).setDetailText(
|
||||||
|
Constants.IPV6_DNS.getHostAddress() + "\n" +
|
||||||
Constants.IPV4_DNS1.getHostAddress() + "\n" +
|
Constants.IPV4_DNS1.getHostAddress() + "\n" +
|
||||||
Constants.IPV4_DNS2.getHostAddress());
|
Constants.IPV4_DNS2.getHostAddress());
|
||||||
inOrder.verify(mockDnsPref).setVisible(true);
|
inOrder.verify(mockDnsPref).setVisible(true);
|
||||||
|
Reference in New Issue
Block a user