Add the nopass handling in the Android client.

TODO:
1. Document the encoding.
2. Test out the interaction with appspot.com with escaped semicolons and colons



git-svn-id: https://zxing.googlecode.com/svn/trunk@1440 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
vikrama 2010-06-17 04:33:59 +00:00
parent c938a5d196
commit 737fee3e69

View file

@ -45,12 +45,14 @@ public class WifiActivity extends Activity {
private ConnectedReceiver connectedReceiver;
public enum NetworkType {
NETWORK_WEP, NETWORK_WPA,
NETWORK_WEP, NETWORK_WPA, NETWORK_NOPASS,
}
private int changeNetwork(NetworkSetting setting) {
// If the password is empty, this is an unencrypted network
if (setting.getPassword() == null || setting.getPassword().length() == 0) {
if (setting.getPassword() == null || setting.getPassword().length() == 0 ||
setting.getNetworkType() == null ||
setting.getNetworkType() == NetworkType.NETWORK_NOPASS) {
return changeNetworkUnEncrypted(setting);
}
if (setting.getNetworkType() == NetworkType.NETWORK_WPA) {
@ -157,6 +159,8 @@ public class WifiActivity extends Activity {
networkT = NetworkType.NETWORK_WPA;
} else if (networkType.contains("WEP")) {
networkT = NetworkType.NETWORK_WEP;
} else if (networkType.contains("nopass")) {
networkT = NetworkType.NETWORK_NOPASS;
} else {
// Got an incorrect network type
finish();