Fix the double-quoted SSID issue.
Bug id http://b/issue?id=2684571 Change-Id: I0f1e508b9a3d0fefcef28235380392368a51e42a
This commit is contained in:
@@ -74,7 +74,7 @@ class AccessPoint extends Preference {
|
||||
AccessPoint(Context context, WifiConfiguration config) {
|
||||
super(context);
|
||||
setWidgetLayoutResource(R.layout.preference_widget_wifi_signal);
|
||||
ssid = (config.SSID == null ? "" : config.SSID);
|
||||
ssid = (config.SSID == null ? "" : removeDoubleQuotes(config.SSID));
|
||||
security = getSecurity(config);
|
||||
networkId = config.networkId;
|
||||
mConfig = config;
|
||||
@@ -181,6 +181,19 @@ class AccessPoint extends Preference {
|
||||
return mState;
|
||||
}
|
||||
|
||||
static String removeDoubleQuotes(String string) {
|
||||
int length = string.length();
|
||||
if ((length > 1) && (string.charAt(0) == '"')
|
||||
&& (string.charAt(length - 1) == '"')) {
|
||||
return string.substring(1, length - 1);
|
||||
}
|
||||
return string;
|
||||
}
|
||||
|
||||
static String convertToQuotedString(String string) {
|
||||
return "\"" + string + "\"";
|
||||
}
|
||||
|
||||
private void refresh() {
|
||||
if (mSignal == null) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user