diff options
-rw-r--r-- | app/build.gradle | 2 | ||||
-rw-r--r-- | app/src/main/AndroidManifest.xml | 5 | ||||
-rw-r--r-- | app/src/main/java/github/daneren2005/dsub/activity/SubsonicActivity.java | 13 | ||||
-rw-r--r-- | app/src/main/res/layout/abstract_activity.xml | 3 | ||||
-rw-r--r-- | app/src/main/res/values/strings.xml | 2 |
5 files changed, 18 insertions, 7 deletions
diff --git a/app/build.gradle b/app/build.gradle index 25af8101..8401ac53 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,7 +6,7 @@ android { defaultConfig { applicationId "github.daneren2005.dsub" minSdkVersion 15 - targetSdkVersion 28 + targetSdkVersion 29 versionCode 205 versionName '5.5.1' setProperty("archivesBaseName", "DSub $versionName") diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 11ae1768..2572bbb5 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -22,7 +22,7 @@ <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/> <uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE"/> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> - <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> + <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <uses-feature android:name="android.hardware.touchscreen" android:required="false" /> @@ -91,7 +91,8 @@ </activity> <service android:name="github.daneren2005.dsub.service.DownloadService" - android:label="DSub Playback Service"/> + android:label="DSub Playback Service" + android:foregroundServiceType="location"/> <service android:name="github.daneren2005.dsub.service.AutoMediaBrowserService" android:exported="true"> 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 3b6935eb..d475be7b 100644 --- a/app/src/main/java/github/daneren2005/dsub/activity/SubsonicActivity.java +++ b/app/src/main/java/github/daneren2005/dsub/activity/SubsonicActivity.java @@ -18,6 +18,7 @@ */ package github.daneren2005.dsub.activity; +import android.Manifest; import android.app.UiModeManager; import android.content.Context; import android.content.DialogInterface; @@ -184,6 +185,17 @@ public class SubsonicActivity extends AppCompatActivity implements OnItemSelecte if (ContextCompat.checkSelfPermission(this, permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions(this, new String[]{ permission.WRITE_EXTERNAL_STORAGE }, PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE); } + + SharedPreferences prefs = Util.getPreferences(this); + int instance = prefs.getInt(Constants.PREFERENCES_KEY_SERVER_INSTANCE, 1); + String expectedSSID = prefs.getString(Constants.PREFERENCES_KEY_SERVER_LOCAL_NETWORK_SSID + instance, ""); + if(!expectedSSID.isEmpty()) { + String currentSSID = Util.getSSID(this); + + if(currentSSID == "<unknown ssid>" && 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); + } + } } @Override @@ -204,7 +216,6 @@ public class SubsonicActivity extends AppCompatActivity implements OnItemSelecte } else { Util.toast(this, R.string.permission_location_failed); - finish(); } } } diff --git a/app/src/main/res/layout/abstract_activity.xml b/app/src/main/res/layout/abstract_activity.xml index 56db1439..7ca9b936 100644 --- a/app/src/main/res/layout/abstract_activity.xml +++ b/app/src/main/res/layout/abstract_activity.xml @@ -4,8 +4,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/drawer_layout" android:layout_width="match_parent" - android:layout_height="match_parent" - android:fitsSystemWindows="true"> + android:layout_height="match_parent"> <!-- The main content view --> <FrameLayout diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 2dcee2d6..87ebbe07 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -669,7 +669,7 @@ <string name="details.home_page">Home Page</string> <string name="permission.external_storage.failed">DSub cannot function without the ability to write to storage</string> - <string name="permission.location.failed">This apps uses location data to get the WIFI SSID when the app is in use. No location data is collected.</string> + <string name="permission.location.failed">This apps uses location data to get the WIFI SSID to match against your local network settings. To get rid of this message, change the local network SSID to blank.</string> <plurals name="select_album_n_songs"> <item quantity="zero">No songs</item> |