Loading src/com/android/settings/wifi/details/WifiDetailPreferenceController.java +2 −3 Original line number Diff line number Diff line Loading @@ -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); Loading tests/robotests/src/com/android/settings/wifi/details/WifiDetailPreferenceControllerTest.java +9 −3 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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); } Loading Loading
src/com/android/settings/wifi/details/WifiDetailPreferenceController.java +2 −3 Original line number Diff line number Diff line Loading @@ -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); Loading
tests/robotests/src/com/android/settings/wifi/details/WifiDetailPreferenceControllerTest.java +9 −3 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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); } Loading