Autojoin new unsecured networks without dialog

Unsaved, open wifi networks will connect on single click
without opening the connect dialog box

Change-Id: I71da155aa8b711309f0ed7eca4bd22a254db28c5
This commit is contained in:
Isaac Levy
2011-08-22 21:09:12 -07:00
parent 78545348fd
commit 22d441acdb
2 changed files with 27 additions and 6 deletions

View File

@@ -358,4 +358,19 @@ class AccessPoint extends Preference {
setSummary(summary.toString());
}
}
/**
* Generate and save a default wifiConfiguration with common values.
* Can only be called for unsecured networks.
* @hide
*/
protected void generateOpenNetworkConfig() {
if (security != SECURITY_NONE)
throw new IllegalStateException();
if (mConfig != null)
return;
mConfig = new WifiConfiguration();
mConfig.SSID = AccessPoint.convertToQuotedString(ssid);
mConfig.allowedKeyManagement.set(KeyMgmt.NONE);
}
}