diff options
author | Irfan Sheriff <isheriff@google.com> | 2010-06-24 11:31:41 -0700 |
---|---|---|
committer | Irfan Sheriff <isheriff@google.com> | 2010-06-24 12:04:36 -0700 |
commit | bb480bbb92a6a8707f0ef3f3ccc4b535737d42a7 (patch) | |
tree | 1ae66f6c7dd44b4f5ee6e8c96fb969a1dde56ef4 /src | |
parent | 12fd447d6f46b0c06072b0e9735589bf14cc53f6 (diff) | |
download | packages_apps_Settings-bb480bbb92a6a8707f0ef3f3ccc4b535737d42a7.zip packages_apps_Settings-bb480bbb92a6a8707f0ef3f3ccc4b535737d42a7.tar.gz packages_apps_Settings-bb480bbb92a6a8707f0ef3f3ccc4b535737d42a7.tar.bz2 |
Allow soft AP settings config before bring up
Bug: 2538623
Change-Id: I4b927deb0e4981c164744b85e5c85c3fc95a31eb
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/wifi/WifiApSettings.java | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/com/android/settings/wifi/WifiApSettings.java b/src/com/android/settings/wifi/WifiApSettings.java index 0815238..ca1b856 100644 --- a/src/com/android/settings/wifi/WifiApSettings.java +++ b/src/com/android/settings/wifi/WifiApSettings.java @@ -120,18 +120,25 @@ public class WifiApSettings extends PreferenceActivity if (button == DialogInterface.BUTTON_POSITIVE) { mWifiConfig = mDialog.getConfig(); - if(mWifiConfig != null) { - mWifiManager.setWifiApEnabled(mWifiConfig, true); + if (mWifiConfig != null) { + /** + * if soft AP is running, bring up with new config + * else update the configuration alone + */ + if (mWifiManager.getWifiApState() == WifiManager.WIFI_AP_STATE_ENABLED) { + mWifiManager.setWifiApEnabled(mWifiConfig, true); + /** + * There is no tether notification on changing AP + * configuration. Update status with new config. + */ + mWifiApEnabler.updateConfigSummary(mWifiConfig); + } else { + mWifiManager.setWifiApConfiguration(mWifiConfig); + } mCreateNetwork.setSummary(String.format(getString(CONFIG_SUBTEXT), 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); - } } } |