diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-01-16 07:36:23 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-01-16 07:36:23 -0800 |
commit | b11f8d72673ee0f4cf874e18795c5e25fc62f5f0 (patch) | |
tree | d82ec4d7b71c026d2ac47e71e5bc426177f27afb /src/github/daneren2005 | |
parent | afc140247616764807523c0ea123d8708d9adec3 (diff) | |
download | dsub-b11f8d72673ee0f4cf874e18795c5e25fc62f5f0.tar.gz dsub-b11f8d72673ee0f4cf874e18795c5e25fc62f5f0.tar.bz2 dsub-b11f8d72673ee0f4cf874e18795c5e25fc62f5f0.zip |
Fix internal network being used if SSID is non-null but internal address is null
Diffstat (limited to 'src/github/daneren2005')
-rw-r--r-- | src/github/daneren2005/dsub/util/Util.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/github/daneren2005/dsub/util/Util.java b/src/github/daneren2005/dsub/util/Util.java index 57684d33..05267699 100644 --- a/src/github/daneren2005/dsub/util/Util.java +++ b/src/github/daneren2005/dsub/util/Util.java @@ -360,12 +360,13 @@ public final class Util { StringBuilder builder = new StringBuilder(); String serverUrl = prefs.getString(Constants.PREFERENCES_KEY_SERVER_URL + instance, null); - if(allowAltAddress && - (prefs.getString(Constants.PREFERENCES_KEY_SERVER_LOCAL_NETWORK_SSID + instance, "").equals("") && Util.isWifiConnected(context)) - || prefs.getString(Constants.PREFERENCES_KEY_SERVER_LOCAL_NETWORK_SSID + instance, "").equals(Util.getSSID(context))) { - String internalUrl = prefs.getString(Constants.PREFERENCES_KEY_SERVER_INTERNAL_URL + instance, null); - if(internalUrl != null && !"".equals(internalUrl) && !"http://".equals(internalUrl)) { - serverUrl = internalUrl; + if(allowAltAddress && Util.isWifiConnected(context)) { + String SSID = prefs.getString(Constants.PREFERENCES_KEY_SERVER_LOCAL_NETWORK_SSID + instance, ""); + if("".equals(SSID) || SSID.equals(Util.getSSID(context))) { + String internalUrl = prefs.getString(Constants.PREFERENCES_KEY_SERVER_INTERNAL_URL + instance, null); + if(internalUrl != null && !"".equals(internalUrl) && !"http://".equals(internalUrl)) { + serverUrl = internalUrl; + } } } |