OSDN Git Service

am 599221c7: wifi: Update the AccessPointState network ID after saving configuration.
authorMike Lockwood <lockwood@android.com>
Thu, 16 Jul 2009 01:13:56 +0000 (18:13 -0700)
committerAndroid Git Automerger <android-git-automerger@android.com>
Thu, 16 Jul 2009 01:13:56 +0000 (18:13 -0700)
Merge commit '599221c7bbd6cd613fd4f86805ccaf0696a3e78c'

* commit '599221c7bbd6cd613fd4f86805ccaf0696a3e78c':
  wifi: Update the AccessPointState network ID after saving configuration.

src/com/android/settings/wifi/WifiLayer.java

index 5bcf81f..ce518e1 100644 (file)
@@ -423,6 +423,17 @@ public class WifiLayer {
         }
         
         /*
+         * 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
          */