Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a0661c4f authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge changes Icd3d09aa,I4b070964

* changes:
  Include IPv6 DNS servers in wifi details
  Separate multiple DNS addresses with newlines.
parents 9b7479f8 5b206aec
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -415,11 +415,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);
+9 −3
Original line number Diff line number Diff line
@@ -402,10 +402,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
@@ -511,13 +515,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);
    }