Merge changes Icd3d09aa,I4b070964
am: a0661c4fdf
Change-Id: Id00f5518b6377fd0a6101b8393b4d68da3e02642
This commit is contained in:
@@ -429,11 +429,10 @@ public class WifiDetailPreferenceController extends PreferenceController impleme
|
||||
}
|
||||
}
|
||||
|
||||
// Find IPv4 DNS addresses.
|
||||
// Find all (IPv4 and IPv6) DNS addresses.
|
||||
String dnsServers = mLinkProperties.getDnsServers().stream()
|
||||
.filter(Inet4Address.class::isInstance)
|
||||
.map(InetAddress::getHostAddress)
|
||||
.collect(Collectors.joining(","));
|
||||
.collect(Collectors.joining("\n"));
|
||||
|
||||
// Update UI.
|
||||
updatePreference(mIpAddressPref, ipv4Address);
|
||||
|
@@ -431,10 +431,14 @@ public class WifiDetailPreferenceControllerTest {
|
||||
public void dnsServersPref_shouldHaveDetailTextSet() throws UnknownHostException {
|
||||
mLinkProperties.addDnsServer(InetAddress.getByAddress(new byte[]{8,8,4,4}));
|
||||
mLinkProperties.addDnsServer(InetAddress.getByAddress(new byte[]{8,8,8,8}));
|
||||
mLinkProperties.addDnsServer(Constants.IPV6_DNS);
|
||||
|
||||
displayAndResume();
|
||||
|
||||
verify(mockDnsPref).setDetailText("8.8.4.4,8.8.8.8");
|
||||
verify(mockDnsPref).setDetailText(
|
||||
"8.8.4.4\n" +
|
||||
"8.8.8.8\n" +
|
||||
Constants.IPV6_DNS.getHostAddress());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -540,13 +544,15 @@ public class WifiDetailPreferenceControllerTest {
|
||||
|
||||
lp.addDnsServer(Constants.IPV6_DNS);
|
||||
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_DNS2);
|
||||
updateLinkProperties(lp);
|
||||
inOrder.verify(mockDnsPref).setDetailText(
|
||||
Constants.IPV4_DNS1.getHostAddress() + "," +
|
||||
Constants.IPV6_DNS.getHostAddress() + "\n" +
|
||||
Constants.IPV4_DNS1.getHostAddress() + "\n" +
|
||||
Constants.IPV4_DNS2.getHostAddress());
|
||||
inOrder.verify(mockDnsPref).setVisible(true);
|
||||
}
|
||||
|
Reference in New Issue
Block a user