From 09215909fa1cdecf6de7123c3f51bca08b039658 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Fri, 2 Oct 2020 20:35:36 -0700 Subject: Request location access when opening SSID to make sure it works --- .../main/java/github/daneren2005/dsub/fragments/SettingsFragment.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/src/main') 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 == "" && 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() { -- cgit v1.2.3