Update AP config status

Bug: 2533950
Change-Id: Idac1213b9dc44c073fa5cf8da00b8599161565f2
This commit is contained in:
Irfan Sheriff
2010-03-22 11:34:48 -07:00
parent 38925c0b96
commit 3e5cfe8f0a
2 changed files with 15 additions and 6 deletions

View 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);
}

View 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);
}
}
}