summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIrfan Sheriff <isheriff@google.com>2010-05-17 12:46:03 -0700
committerIrfan Sheriff <isheriff@google.com>2010-05-17 13:20:39 -0700
commit18dc7ea709bce68b44ed4fd6f8f65308c3b9101b (patch)
tree0b6c7c9f8ae60d2ddb8885d2abd5c54eb1d5b021
parent8c81257f70fabeaa505e292bd0c2226dd5eefc4c (diff)
downloadpackages_apps_Settings-18dc7ea709bce68b44ed4fd6f8f65308c3b9101b.zip
packages_apps_Settings-18dc7ea709bce68b44ed4fd6f8f65308c3b9101b.tar.gz
packages_apps_Settings-18dc7ea709bce68b44ed4fd6f8f65308c3b9101b.tar.bz2
Fix crash for tether with quotes in SSID
Multiple quotes cause havoc with netd interaction right now. The solution is to revert the changes for WifiConfiguration on Access Point side done in Change I0f1e508b and remove all quotes in the SSID. Essentially a low risk one line change on top of the revert. We dont expose API for WifiConfiguration on AP side. This solution essentially means we treat SSID in WifiConfiguration on AP side differently. When we do expose things, we should make things consistent. Change-Id: I0a7e5074b83ace743fc843ee61c1ff86cde8267f
-rw-r--r--src/com/android/settings/wifi/WifiApDialog.java10
-rw-r--r--src/com/android/settings/wifi/WifiApEnabler.java3
-rw-r--r--src/com/android/settings/wifi/WifiApSettings.java4
3 files changed, 11 insertions, 6 deletions
diff --git a/src/com/android/settings/wifi/WifiApDialog.java b/src/com/android/settings/wifi/WifiApDialog.java
index 6f2d15f..b7ca4fc 100644
--- a/src/com/android/settings/wifi/WifiApDialog.java
+++ b/src/com/android/settings/wifi/WifiApDialog.java
@@ -72,7 +72,13 @@ class WifiApDialog extends AlertDialog implements View.OnClickListener,
WifiConfiguration config = new WifiConfiguration();
- config.SSID = AccessPoint.convertToQuotedString(mSsid.getText().toString());
+ /**
+ * TODO: SSID in WifiConfiguration for soft ap
+ * is being stored as a raw string without quotes.
+ * This is not the case on the client side. We need to
+ * make things consistent and clean it up
+ */
+ config.SSID = mSsid.getText().toString().replaceAll("\"","");
switch (mSecurityType) {
case AccessPoint.SECURITY_NONE:
@@ -115,7 +121,7 @@ class WifiApDialog extends AlertDialog implements View.OnClickListener,
context.getString(R.string.wifi_cancel), mListener);
if (mWifiConfig != null) {
- mSsid.setText(AccessPoint.removeDoubleQuotes(mWifiConfig.SSID));
+ mSsid.setText(mWifiConfig.SSID);
switch (mSecurityType) {
case AccessPoint.SECURITY_NONE:
mSecurity.setSelection(OPEN_INDEX);
diff --git a/src/com/android/settings/wifi/WifiApEnabler.java b/src/com/android/settings/wifi/WifiApEnabler.java
index 8933a5e..e907cf7 100644
--- a/src/com/android/settings/wifi/WifiApEnabler.java
+++ b/src/com/android/settings/wifi/WifiApEnabler.java
@@ -153,8 +153,7 @@ public class WifiApEnabler implements Preference.OnPreferenceChangeListener {
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 : AccessPoint.removeDoubleQuotes(
- wifiConfig.SSID)));
+ (wifiConfig == null) ? s : wifiConfig.SSID));
}
private void updateTetherState(Object[] available, Object[] tethered, Object[] errored) {
diff --git a/src/com/android/settings/wifi/WifiApSettings.java b/src/com/android/settings/wifi/WifiApSettings.java
index 71e8343..0815238 100644
--- a/src/com/android/settings/wifi/WifiApSettings.java
+++ b/src/com/android/settings/wifi/WifiApSettings.java
@@ -81,7 +81,7 @@ public class WifiApSettings extends PreferenceActivity
s, mSecurityType[OPEN_INDEX]));
} else {
mCreateNetwork.setSummary(String.format(getString(CONFIG_SUBTEXT),
- AccessPoint.removeDoubleQuotes(mWifiConfig.SSID),
+ mWifiConfig.SSID,
mWifiConfig.allowedKeyManagement.get(KeyMgmt.WPA_PSK) ?
mSecurityType[WPA_INDEX] : mSecurityType[OPEN_INDEX]));
}
@@ -123,7 +123,7 @@ public class WifiApSettings extends PreferenceActivity
if(mWifiConfig != null) {
mWifiManager.setWifiApEnabled(mWifiConfig, true);
mCreateNetwork.setSummary(String.format(getString(CONFIG_SUBTEXT),
- AccessPoint.removeDoubleQuotes(mWifiConfig.SSID),
+ mWifiConfig.SSID,
mWifiConfig.allowedKeyManagement.get(KeyMgmt.WPA_PSK) ?
mSecurityType[WPA_INDEX] : mSecurityType[OPEN_INDEX]));
/**