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

Commit 0c455f3d authored by Robert Greenwalt's avatar Robert Greenwalt Committed by Android Git Automerger
Browse files

am 20495d2a: Merge "Fix crash bug with mismatched iface names" into jb-mr2-dev

* commit '20495d2a':
  Fix crash bug with mismatched iface names
parents 3431f7ed 20495d2a
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -1196,7 +1196,7 @@ class WifiConfigStore {
            WifiConfiguration newConfig) {
        boolean ipChanged = false;
        boolean proxyChanged = false;
        LinkProperties linkProperties = new LinkProperties();
        LinkProperties linkProperties = null;

        switch (newConfig.ipAssignment) {
            case STATIC:
@@ -1262,10 +1262,10 @@ class WifiConfigStore {
        }

        if (!ipChanged) {
            addIpSettingsFromConfig(linkProperties, currentConfig);
            linkProperties = copyIpSettingsFromConfig(currentConfig);
        } else {
            currentConfig.ipAssignment = newConfig.ipAssignment;
            addIpSettingsFromConfig(linkProperties, newConfig);
            linkProperties = copyIpSettingsFromConfig(newConfig);
            log("IP config changed SSID = " + currentConfig.SSID + " linkProperties: " +
                    linkProperties.toString());
        }
@@ -1291,8 +1291,9 @@ class WifiConfigStore {
        return new NetworkUpdateResult(ipChanged, proxyChanged);
    }

    private void addIpSettingsFromConfig(LinkProperties linkProperties,
            WifiConfiguration config) {
    private LinkProperties copyIpSettingsFromConfig(WifiConfiguration config) {
        LinkProperties linkProperties = new LinkProperties();
        linkProperties.setInterfaceName(config.linkProperties.getInterfaceName());
        for (LinkAddress linkAddr : config.linkProperties.getLinkAddresses()) {
            linkProperties.addLinkAddress(linkAddr);
        }
@@ -1302,6 +1303,7 @@ class WifiConfigStore {
        for (InetAddress dns : config.linkProperties.getDnses()) {
            linkProperties.addDns(dns);
        }
        return linkProperties;
    }

    /**