Merge commit '40686ee81f95699d7a83ccb1ef1be52c0c746d4f' * commit '40686ee81f95699d7a83ccb1ef1be52c0c746d4f': Allow soft AP settings config before bring up
This commit is contained in:
@@ -28,7 +28,6 @@
|
|||||||
|
|
||||||
<PreferenceScreen
|
<PreferenceScreen
|
||||||
android:key="wifi_ap_settings"
|
android:key="wifi_ap_settings"
|
||||||
android:dependency="enable_wifi_ap"
|
|
||||||
android:title="@string/wifi_tether_settings_text"
|
android:title="@string/wifi_tether_settings_text"
|
||||||
android:summary="@string/wifi_tether_settings_subtext" >
|
android:summary="@string/wifi_tether_settings_subtext" >
|
||||||
<intent
|
<intent
|
||||||
|
@@ -24,7 +24,6 @@
|
|||||||
|
|
||||||
<Preference
|
<Preference
|
||||||
android:key="wifi_ap_ssid_and_security"
|
android:key="wifi_ap_ssid_and_security"
|
||||||
android:dependency="enable_wifi_ap"
|
|
||||||
android:title="@string/wifi_tether_configure_ap_text"
|
android:title="@string/wifi_tether_configure_ap_text"
|
||||||
android:persistent="false" />
|
android:persistent="false" />
|
||||||
|
|
||||||
|
@@ -120,18 +120,25 @@ public class WifiApSettings extends PreferenceActivity
|
|||||||
|
|
||||||
if (button == DialogInterface.BUTTON_POSITIVE) {
|
if (button == DialogInterface.BUTTON_POSITIVE) {
|
||||||
mWifiConfig = mDialog.getConfig();
|
mWifiConfig = mDialog.getConfig();
|
||||||
if(mWifiConfig != null) {
|
if (mWifiConfig != null) {
|
||||||
mWifiManager.setWifiApEnabled(mWifiConfig, true);
|
/**
|
||||||
|
* 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),
|
mCreateNetwork.setSummary(String.format(getString(CONFIG_SUBTEXT),
|
||||||
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