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

Commit 52b37f00 authored by Irfan Sheriff's avatar Irfan Sheriff
Browse files

update current config with dhcp settings

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

Change-Id: Ied0215ba397efb1182800f1c9a8320fef1c6b319
parent 84af86c4
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: " +