mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
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:
parent
c938a5d196
commit
737fee3e69
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue