From 599221c7bbd6cd613fd4f86805ccaf0696a3e78c Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Wed, 15 Jul 2009 11:55:32 -0400 Subject: [PATCH] wifi: Update the AccessPointState network ID after saving configuration. If there are more than 10 open access points, the network ID may have changed after the configuration is saved. Signed-off-by: Mike Lockwood --- src/com/android/settings/wifi/WifiLayer.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/com/android/settings/wifi/WifiLayer.java b/src/com/android/settings/wifi/WifiLayer.java index f2752379ff4..5d896aaec2c 100644 --- a/src/com/android/settings/wifi/WifiLayer.java +++ b/src/com/android/settings/wifi/WifiLayer.java @@ -422,6 +422,17 @@ public class WifiLayer { return false; } + /* + * It's necessary to update the network id of this state because the network id + * could have changed after the configuration is saved. For example, if there are + * more than 10 saved open-networks, some older open-networks will have been be forgotten. + */ + state.setNetworkId(AccessPointState.NETWORK_ID_ANY); + config = findConfiguredNetwork(state); + if (config != null) { + state.setNetworkId(config.networkId); + } + /* * We could reload the configured networks, but instead just shortcut * and add this state to our list in memory