summaryrefslogtreecommitdiffstats
path: root/wifi
diff options
context:
space:
mode:
Diffstat (limited to 'wifi')
-rw-r--r--wifi/java/android/net/wifi/WifiConfigStore.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/wifi/java/android/net/wifi/WifiConfigStore.java b/wifi/java/android/net/wifi/WifiConfigStore.java
index 47f1fbf..7b1a71f 100644
--- a/wifi/java/android/net/wifi/WifiConfigStore.java
+++ b/wifi/java/android/net/wifi/WifiConfigStore.java
@@ -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;
}
/**