From b11f8d72673ee0f4cf874e18795c5e25fc62f5f0 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Thu, 16 Jan 2014 07:36:23 -0800 Subject: Fix internal network being used if SSID is non-null but internal address is null --- src/github/daneren2005/dsub/util/Util.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/github') 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; + } } } -- cgit v1.2.3