Update AP config status
Bug: 2533950 Change-Id: Idac1213b9dc44c073fa5cf8da00b8599161565f2
This commit is contained in:
@@ -107,6 +107,14 @@ public class WifiApEnabler implements Preference.OnPreferenceChangeListener {
|
|||||||
return false;
|
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) {
|
private void updateTetherState(Object[] available, Object[] tethered, Object[] errored) {
|
||||||
boolean wifiTethered = false;
|
boolean wifiTethered = false;
|
||||||
boolean wifiErrored = false;
|
boolean wifiErrored = false;
|
||||||
@@ -125,12 +133,8 @@ public class WifiApEnabler implements Preference.OnPreferenceChangeListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (wifiTethered) {
|
if (wifiTethered) {
|
||||||
WifiConfiguration mWifiConfig = mWifiManager.getWifiApConfiguration();
|
WifiConfiguration wifiConfig = mWifiManager.getWifiApConfiguration();
|
||||||
String s = mContext.getString(
|
updateConfigSummary(wifiConfig);
|
||||||
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));
|
|
||||||
} else if (wifiErrored) {
|
} else if (wifiErrored) {
|
||||||
mCheckBox.setSummary(R.string.wifi_error);
|
mCheckBox.setSummary(R.string.wifi_error);
|
||||||
}
|
}
|
||||||
|
@@ -122,6 +122,11 @@ public class WifiApSettings extends PreferenceActivity
|
|||||||
mWifiConfig.SSID,
|
mWifiConfig.SSID,
|
||||||
mWifiConfig.allowedKeyManagement.get(KeyMgmt.WPA_PSK) ?
|
mWifiConfig.allowedKeyManagement.get(KeyMgmt.WPA_PSK) ?
|
||||||
mSecurityType[WPA_INDEX] : mSecurityType[OPEN_INDEX]));
|
mSecurityType[WPA_INDEX] : mSecurityType[OPEN_INDEX]));
|
||||||
|
/**
|
||||||
|
* There is no tether notification on changing AP
|
||||||
|
* configuration. Update status with new config.
|
||||||
|
*/
|
||||||
|
mWifiApEnabler.updateConfigSummary(mWifiConfig);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user