Loading wifi/java/android/net/wifi/WifiConfigStore.java +33 −14 Original line number Diff line number Diff line Loading @@ -281,7 +281,11 @@ class WifiConfigStore { if (WifiNative.removeNetworkCommand(netId)) { WifiNative.saveConfigCommand(); synchronized (sConfiguredNetworks) { WifiConfiguration config = sConfiguredNetworks.get(netId); if (config != null) { sConfiguredNetworks.remove(netId); sNetworkIds.remove(configKey(config)); } } writeIpAndProxyConfigurations(); sendConfiguredNetworksChangedBroadcast(); Loading Loading @@ -315,7 +319,13 @@ class WifiConfigStore { static boolean removeNetwork(int netId) { boolean ret = WifiNative.removeNetworkCommand(netId); synchronized (sConfiguredNetworks) { if (ret) sConfiguredNetworks.remove(netId); if (ret) { WifiConfiguration config = sConfiguredNetworks.get(netId); if (config != null) { sConfiguredNetworks.remove(netId); sNetworkIds.remove(configKey(config)); } } } sendConfiguredNetworksChangedBroadcast(); return ret; Loading Loading @@ -854,17 +864,23 @@ class WifiConfigStore { * refer to an existing configuration. */ int netId = config.networkId; boolean updateFailed = true; boolean newNetwork = false; // networkId of INVALID_NETWORK_ID means we want to create a new network boolean newNetwork = (netId == INVALID_NETWORK_ID); if (newNetwork) { if (netId == INVALID_NETWORK_ID) { Integer savedNetId = sNetworkIds.get(configKey(config)); if (savedNetId != null) { netId = savedNetId; } else { newNetwork = true; netId = WifiNative.addNetworkCommand(); if (netId < 0) { Log.e(TAG, "Failed to add a network!"); return new NetworkUpdateResult(INVALID_NETWORK_ID); } } } boolean updateFailed = true; setVariables: { Loading Loading @@ -1053,11 +1069,14 @@ class WifiConfigStore { if (sConfig == null) { sConfig = new WifiConfiguration(); sConfig.networkId = netId; } readNetworkVariables(sConfig); synchronized (sConfiguredNetworks) { sConfiguredNetworks.put(netId, sConfig); sNetworkIds.put(configKey(sConfig), netId); } } readNetworkVariables(sConfig); NetworkUpdateResult result = writeIpAndProxyConfigurationsOnChange(sConfig, config); result.setNetworkId(netId); Loading Loading
wifi/java/android/net/wifi/WifiConfigStore.java +33 −14 Original line number Diff line number Diff line Loading @@ -281,7 +281,11 @@ class WifiConfigStore { if (WifiNative.removeNetworkCommand(netId)) { WifiNative.saveConfigCommand(); synchronized (sConfiguredNetworks) { WifiConfiguration config = sConfiguredNetworks.get(netId); if (config != null) { sConfiguredNetworks.remove(netId); sNetworkIds.remove(configKey(config)); } } writeIpAndProxyConfigurations(); sendConfiguredNetworksChangedBroadcast(); Loading Loading @@ -315,7 +319,13 @@ class WifiConfigStore { static boolean removeNetwork(int netId) { boolean ret = WifiNative.removeNetworkCommand(netId); synchronized (sConfiguredNetworks) { if (ret) sConfiguredNetworks.remove(netId); if (ret) { WifiConfiguration config = sConfiguredNetworks.get(netId); if (config != null) { sConfiguredNetworks.remove(netId); sNetworkIds.remove(configKey(config)); } } } sendConfiguredNetworksChangedBroadcast(); return ret; Loading Loading @@ -854,17 +864,23 @@ class WifiConfigStore { * refer to an existing configuration. */ int netId = config.networkId; boolean updateFailed = true; boolean newNetwork = false; // networkId of INVALID_NETWORK_ID means we want to create a new network boolean newNetwork = (netId == INVALID_NETWORK_ID); if (newNetwork) { if (netId == INVALID_NETWORK_ID) { Integer savedNetId = sNetworkIds.get(configKey(config)); if (savedNetId != null) { netId = savedNetId; } else { newNetwork = true; netId = WifiNative.addNetworkCommand(); if (netId < 0) { Log.e(TAG, "Failed to add a network!"); return new NetworkUpdateResult(INVALID_NETWORK_ID); } } } boolean updateFailed = true; setVariables: { Loading Loading @@ -1053,11 +1069,14 @@ class WifiConfigStore { if (sConfig == null) { sConfig = new WifiConfiguration(); sConfig.networkId = netId; } readNetworkVariables(sConfig); synchronized (sConfiguredNetworks) { sConfiguredNetworks.put(netId, sConfig); sNetworkIds.put(configKey(sConfig), netId); } } readNetworkVariables(sConfig); NetworkUpdateResult result = writeIpAndProxyConfigurationsOnChange(sConfig, config); result.setNetworkId(netId); Loading