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

Commit d3f4a27c authored by Erik Kline's avatar Erik Kline Committed by android-build-merger
Browse files

Merge changes Icd3d09aa,I4b070964

am: a0661c4f

Change-Id: Id00f5518b6377fd0a6101b8393b4d68da3e02642
parents d3c72406 a0661c4f
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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);
+9 −3
Original line number Diff line number Diff line
@@ -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);
    }