aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2020-10-02 20:35:36 -0700
committerScott Jackson <daneren2005@gmail.com>2020-10-02 20:35:36 -0700
commit09215909fa1cdecf6de7123c3f51bca08b039658 (patch)
tree3eea8885ac0a6ac0cd249a1e7cceff5267833f7e /app/src/main/java
parentbf5f8ef21ae6415ae5b7a4ed2525fec1a1dc5420 (diff)
downloaddsub-09215909fa1cdecf6de7123c3f51bca08b039658.tar.gz
dsub-09215909fa1cdecf6de7123c3f51bca08b039658.tar.bz2
dsub-09215909fa1cdecf6de7123c3f51bca08b039658.zip
Request location access when opening SSID to make sure it works
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/fragments/SettingsFragment.java4
1 files changed, 4 insertions, 0 deletions
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 1789ad15..31559305 100644
--- a/app/src/main/java/github/daneren2005/dsub/fragments/SettingsFragment.java
+++ b/app/src/main/java/github/daneren2005/dsub/fragments/SettingsFragment.java
@@ -528,6 +528,10 @@ 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) {
+ ActivityCompat.requestPermissions(context, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, SubsonicActivity.PERMISSIONS_REQUEST_LOCATION);
+ }
+
Button defaultButton = new Button(getContext());
defaultButton.setText(internalSSIDDisplay);
defaultButton.setOnClickListener(new View.OnClickListener() {