aboutsummaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@users.noreply.github.com>2021-05-15 21:28:03 -0700
committerGitHub <noreply@github.com>2021-05-15 21:28:03 -0700
commitf786c6322d379db837d9d5315c25ef62924ce0c3 (patch)
treec62491950e7517c68cd1873ab85ebabce44b68ff /app/src
parent3a6d412ffa3c92021ddefd98a5181b9fefc97817 (diff)
parentba017fc001d2d0bf55a10ba42480dd9fa19f6125 (diff)
downloaddsub-f786c6322d379db837d9d5315c25ef62924ce0c3.tar.gz
dsub-f786c6322d379db837d9d5315c25ef62924ce0c3.tar.bz2
dsub-f786c6322d379db837d9d5315c25ef62924ce0c3.zip
Merge pull request #1069 from mrtxema/fix-ssid-check
Fix current SSID detection
Diffstat (limited to 'app/src')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/activity/SubsonicActivity.java2
-rw-r--r--app/src/main/java/github/daneren2005/dsub/fragments/SettingsFragment.java2
-rw-r--r--app/src/main/java/github/daneren2005/dsub/util/Util.java6
3 files changed, 5 insertions, 5 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/activity/SubsonicActivity.java b/app/src/main/java/github/daneren2005/dsub/activity/SubsonicActivity.java
index eabc1a07..2416832d 100644
--- a/app/src/main/java/github/daneren2005/dsub/activity/SubsonicActivity.java
+++ b/app/src/main/java/github/daneren2005/dsub/activity/SubsonicActivity.java
@@ -192,7 +192,7 @@ public class SubsonicActivity extends AppCompatActivity implements OnItemSelecte
if(!expectedSSID.isEmpty()) {
String currentSSID = Util.getSSID(this);
- if(currentSSID == "<unknown ssid>" && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
+ if("<unknown ssid>".equals(currentSSID) && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, SubsonicActivity.PERMISSIONS_REQUEST_LOCATION);
}
}
diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/SettingsFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/SettingsFragment.java
index c5463f38..f76677d5 100644
--- a/app/src/main/java/github/daneren2005/dsub/fragments/SettingsFragment.java
+++ b/app/src/main/java/github/daneren2005/dsub/fragments/SettingsFragment.java
@@ -528,7 +528,7 @@ public class SettingsFragment extends PreferenceCompatFragment implements Shared
super.onAddEditTextToDialogView(dialogView, editText);
ViewGroup root = (ViewGroup) ((ViewGroup) dialogView).getChildAt(0);
- if(internalSSID == "<unknown ssid>" && ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
+ if("<unknown ssid>".equals(internalSSID) && ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(context, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, SubsonicActivity.PERMISSIONS_REQUEST_LOCATION);
}
diff --git a/app/src/main/java/github/daneren2005/dsub/util/Util.java b/app/src/main/java/github/daneren2005/dsub/util/Util.java
index 872e9561..1aa17c35 100644
--- a/app/src/main/java/github/daneren2005/dsub/util/Util.java
+++ b/app/src/main/java/github/daneren2005/dsub/util/Util.java
@@ -354,9 +354,9 @@ public final class Util {
String currentSSID = Util.getSSID(context);
String[] ssidParts = SSID.split(",");
- if ("".equals(SSID) || SSID.equals(currentSSID) || Arrays.asList(ssidParts).contains(currentSSID)) {
- String internalUrl = prefs.getString(Constants.PREFERENCES_KEY_SERVER_INTERNAL_URL + instance, null);
- if (internalUrl != null && !"".equals(internalUrl) && !"http://".equals(internalUrl)) {
+ if (SSID.equals(currentSSID) || Arrays.asList(ssidParts).contains(currentSSID)) {
+ String internalUrl = prefs.getString(Constants.PREFERENCES_KEY_SERVER_INTERNAL_URL + instance, "");
+ if (!internalUrl.isEmpty() && !"http://".equals(internalUrl)) {
serverUrl = internalUrl;
}
}