OSDN Git Service

Update AP config status
authorIrfan Sheriff <isheriff@google.com>
Mon, 22 Mar 2010 18:34:48 +0000 (11:34 -0700)
committerIrfan Sheriff <isheriff@google.com>
Mon, 22 Mar 2010 21:50:46 +0000 (14:50 -0700)
Bug: 2533950
Change-Id: Idac1213b9dc44c073fa5cf8da00b8599161565f2

src/com/android/settings/wifi/WifiApEnabler.java
src/com/android/settings/wifi/WifiApSettings.java

index 6049623..3d8d282 100644 (file)
@@ -107,6 +107,14 @@ public class WifiApEnabler implements Preference.OnPreferenceChangeListener {
         return false;
     }
 
+    void updateConfigSummary(WifiConfiguration wifiConfig) {
+        String s = mContext.getString(
+                com.android.internal.R.string.wifi_tether_configure_ssid_default);
+        mCheckBox.setSummary(String.format(
+                    mContext.getString(R.string.wifi_tether_enabled_subtext),
+                    (wifiConfig == null) ? s : wifiConfig.SSID));
+    }
+
     private void updateTetherState(Object[] available, Object[] tethered, Object[] errored) {
         boolean wifiTethered = false;
         boolean wifiErrored = false;
@@ -125,12 +133,8 @@ public class WifiApEnabler implements Preference.OnPreferenceChangeListener {
         }
 
         if (wifiTethered) {
-            WifiConfiguration mWifiConfig = mWifiManager.getWifiApConfiguration();
-            String s = mContext.getString(
-                    com.android.internal.R.string.wifi_tether_configure_ssid_default);
-            mCheckBox.setSummary(String.format(
-                    mContext.getString(R.string.wifi_tether_enabled_subtext),
-                    (mWifiConfig == null) ? s : mWifiConfig.SSID));
+            WifiConfiguration wifiConfig = mWifiManager.getWifiApConfiguration();
+            updateConfigSummary(wifiConfig);
         } else if (wifiErrored) {
             mCheckBox.setSummary(R.string.wifi_error);
         }
index b8fb904..ec1016e 100644 (file)
@@ -122,6 +122,11 @@ public class WifiApSettings extends PreferenceActivity
                                       mWifiConfig.SSID,
                                       mWifiConfig.allowedKeyManagement.get(KeyMgmt.WPA_PSK) ?
                                       mSecurityType[WPA_INDEX] : mSecurityType[OPEN_INDEX]));
+            /**
+             * There is no tether notification on changing AP
+             * configuration. Update status with new config.
+             */
+            mWifiApEnabler.updateConfigSummary(mWifiConfig);
         }
     }
 }