Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 15fe0e47 authored by Irfan Sheriff's avatar Irfan Sheriff Committed by Android (Google) Code Review
Browse files

Merge "Allow soft AP settings config before bring up" into gingerbread

parents c01b0c83 bb480bbb
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@

    <PreferenceScreen
        android:key="wifi_ap_settings"
        android:dependency="enable_wifi_ap"
        android:title="@string/wifi_tether_settings_text"
        android:summary="@string/wifi_tether_settings_subtext" >
        <intent
+0 −1
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@

    <Preference
        android:key="wifi_ap_ssid_and_security"
        android:dependency="enable_wifi_ap"
        android:title="@string/wifi_tether_configure_ap_text"
        android:persistent="false" />

+15 −8
Original line number Diff line number Diff line
@@ -121,17 +121,24 @@ public class WifiApSettings extends PreferenceActivity
        if (button == DialogInterface.BUTTON_POSITIVE) {
            mWifiConfig = mDialog.getConfig();
            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);
                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);

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