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

Commit 84cffa45 authored by Irfan Sheriff's avatar Irfan Sheriff Committed by Irfan SHeriff
Browse files

DO NOT MERGE update current config with dhcp settings

After DHCP completes, update the current configured
networks list with the IP setting details

Change-Id: I1ece1eda20224c69a4635bd38fdc5bef15818bb2
parent 6c8d7652
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -460,6 +460,25 @@ class WifiConfigStore {
        return dhcpInfoInternal;
    }

    /**
     * set IP configuration for a given network id
     */
    static void setIpConfiguration(int netId, DhcpInfoInternal dhcpInfo) {
        LinkProperties linkProperties = dhcpInfo.makeLinkProperties();

        synchronized (sConfiguredNetworks) {
            WifiConfiguration config = sConfiguredNetworks.get(netId);
            if (config != null) {
                // add old proxy details
                if(config.linkProperties != null) {
                    linkProperties.setHttpProxy(config.linkProperties.getHttpProxy());
                }
                config.linkProperties = linkProperties;
            }
        }
    }


    /**
     * Fetch the proxy properties for a given network id
     */
+1 −0
Original line number Diff line number Diff line
@@ -2510,6 +2510,7 @@ public class WifiStateMachine extends HierarchicalStateMachine {
                            synchronized (mDhcpInfoInternal) {
                                mDhcpInfoInternal = dhcpInfoInternal;
                            }
                            WifiConfigStore.setIpConfiguration(mLastNetworkId, dhcpInfoInternal);
                            sendMessage(CMD_IP_CONFIG_SUCCESS);
                        } else {
                            Log.d(TAG, "DHCP request failed: " +