From 60e5714311f4ec6d0135397b2beeb5dd511cf318 Mon Sep 17 00:00:00 2001 From: Irfan Sheriff Date: Tue, 1 Dec 2009 15:59:08 -0800 Subject: [PATCH] Missing Forget button after doing Add Network on an AP in the scanned list Problem: On the Wifi Settings screen, if instead of clicking on the AP shown on the scanned list, we do an "Add Wi-Fi network" and enter the AP information - the AP information gets stored and the client device connects to the AP. Afterwards, if we click on the AP again the "Forget" button does not appear until we exit the Wifi Settings screen and return. Root cause and Fix: mApScanList in WifiLayer tracks the list of APs shown. Upon doing a connect through a direct click, the configured state for the AP in the list updated. However, if we do an Add Network, the configured state on mApScanList remains unupdated. This causes the Settings screen to not show "Forget" for the AP when it is clicked. The fix is to set the Configured state to true in handleSave() by fetching the AP state stored in WifiLayer. Bug: 2296038 Change-id: I70c545905a4984a03a0f235f3baf17cd36688710 --- src/com/android/settings/wifi/AccessPointDialog.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/com/android/settings/wifi/AccessPointDialog.java b/src/com/android/settings/wifi/AccessPointDialog.java index 8eb31488fba..69fad0fa4d7 100644 --- a/src/com/android/settings/wifi/AccessPointDialog.java +++ b/src/com/android/settings/wifi/AccessPointDialog.java @@ -632,15 +632,18 @@ public class AccessPointDialog extends AlertDialog implements DialogInterface.On updateEnterpriseFields(); } + /* AP state on the current scan list needs update to enable "Forget" capability */ + mWifiLayer.getWifiLayerApInstance(mState).setConfigured(true); + if (!mWifiLayer.saveNetwork(mState)) { return; } - + // Connect right away if they've touched it if (!mWifiLayer.connectToNetwork(mState)) { return; } - + } private int getSelectionIndex(String[] array, String selection) {