Skip to content

Commit 0690679

Browse files
author
Xia Wang
committed
If the network SSID is a string, it should be enclosed in double quotation marks.
bug id: 2701058 Change-Id: I40e10ba096053710d4974b005d0d2e7c309ccffe
1 parent dc737ca commit 0690679

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerTestActivity.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ public boolean connectToWifi(String knownSSID) {
301301
if (sr.SSID.equals(knownSSID)) {
302302
Log.v(LOG_TAG, "found " + knownSSID + " in the scan result list");
303303
WifiConfiguration config = new WifiConfiguration();
304-
config.SSID = sr.SSID;
304+
config.SSID = convertToQuotedString(sr.SSID);
305305
config.allowedKeyManagement.set(KeyMgmt.NONE);
306306
int networkId = mWifiManager.addNetwork(config);
307307
// Connect to network by disabling others.
@@ -387,6 +387,10 @@ public void setAirplaneMode(Context context, boolean enableAM) {
387387
context.sendBroadcast(intent);
388388
}
389389

390+
protected static String convertToQuotedString(String string) {
391+
return "\"" + string + "\"";
392+
}
393+
390394
@Override
391395
protected void onDestroy() {
392396
super.onDestroy();

0 commit comments

Comments
 (0)