packages/apps/Settings
Révision | 18dc7ea709bce68b44ed4fd6f8f65308c3b9101b (tree) |
---|---|
l'heure | 2010-05-18 05:20:39 |
Auteur | Irfan Sheriff <isheriff@goog...> |
Commiter | Irfan Sheriff |
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
@@ -72,7 +72,13 @@ class WifiApDialog extends AlertDialog implements View.OnClickListener, | ||
72 | 72 | |
73 | 73 | WifiConfiguration config = new WifiConfiguration(); |
74 | 74 | |
75 | - config.SSID = AccessPoint.convertToQuotedString(mSsid.getText().toString()); | |
75 | + /** | |
76 | + * TODO: SSID in WifiConfiguration for soft ap | |
77 | + * is being stored as a raw string without quotes. | |
78 | + * This is not the case on the client side. We need to | |
79 | + * make things consistent and clean it up | |
80 | + */ | |
81 | + config.SSID = mSsid.getText().toString().replaceAll("\"",""); | |
76 | 82 | |
77 | 83 | switch (mSecurityType) { |
78 | 84 | case AccessPoint.SECURITY_NONE: |
@@ -115,7 +121,7 @@ class WifiApDialog extends AlertDialog implements View.OnClickListener, | ||
115 | 121 | context.getString(R.string.wifi_cancel), mListener); |
116 | 122 | |
117 | 123 | if (mWifiConfig != null) { |
118 | - mSsid.setText(AccessPoint.removeDoubleQuotes(mWifiConfig.SSID)); | |
124 | + mSsid.setText(mWifiConfig.SSID); | |
119 | 125 | switch (mSecurityType) { |
120 | 126 | case AccessPoint.SECURITY_NONE: |
121 | 127 | mSecurity.setSelection(OPEN_INDEX); |
@@ -153,8 +153,7 @@ public class WifiApEnabler implements Preference.OnPreferenceChangeListener { | ||
153 | 153 | com.android.internal.R.string.wifi_tether_configure_ssid_default); |
154 | 154 | mCheckBox.setSummary(String.format( |
155 | 155 | mContext.getString(R.string.wifi_tether_enabled_subtext), |
156 | - (wifiConfig == null) ? s : AccessPoint.removeDoubleQuotes( | |
157 | - wifiConfig.SSID))); | |
156 | + (wifiConfig == null) ? s : wifiConfig.SSID)); | |
158 | 157 | } |
159 | 158 | |
160 | 159 | private void updateTetherState(Object[] available, Object[] tethered, Object[] errored) { |
@@ -81,7 +81,7 @@ public class WifiApSettings extends PreferenceActivity | ||
81 | 81 | s, mSecurityType[OPEN_INDEX])); |
82 | 82 | } else { |
83 | 83 | mCreateNetwork.setSummary(String.format(getString(CONFIG_SUBTEXT), |
84 | - AccessPoint.removeDoubleQuotes(mWifiConfig.SSID), | |
84 | + mWifiConfig.SSID, | |
85 | 85 | mWifiConfig.allowedKeyManagement.get(KeyMgmt.WPA_PSK) ? |
86 | 86 | mSecurityType[WPA_INDEX] : mSecurityType[OPEN_INDEX])); |
87 | 87 | } |
@@ -123,7 +123,7 @@ public class WifiApSettings extends PreferenceActivity | ||
123 | 123 | if(mWifiConfig != null) { |
124 | 124 | mWifiManager.setWifiApEnabled(mWifiConfig, true); |
125 | 125 | mCreateNetwork.setSummary(String.format(getString(CONFIG_SUBTEXT), |
126 | - AccessPoint.removeDoubleQuotes(mWifiConfig.SSID), | |
126 | + mWifiConfig.SSID, | |
127 | 127 | mWifiConfig.allowedKeyManagement.get(KeyMgmt.WPA_PSK) ? |
128 | 128 | mSecurityType[WPA_INDEX] : mSecurityType[OPEN_INDEX])); |
129 | 129 | /** |