From 1efb5b3df99c7a5fc87cb025aa5850f101cbf6ce Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Mon, 12 Oct 2020 20:54:24 -0700 Subject: Initial upgrade to target SDK 29 --- app/build.gradle | 2 +- app/src/main/AndroidManifest.xml | 5 +++-- 2 files changed, 4 insertions(+), 3 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 @@ - + @@ -91,7 +91,8 @@ + android:label="DSub Playback Service" + android:foregroundServiceType="location"/> -- cgit v1.2.3 From 28cf757952f789896bf8e8b5174947b03942f792 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Mon, 12 Oct 2020 20:56:59 -0700 Subject: Request location permissions on every startup if not given --- .../github/daneren2005/dsub/activity/SubsonicActivity.java | 13 ++++++++++++- app/src/main/res/values/strings.xml | 2 +- 2 files changed, 13 insertions(+), 2 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 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 == "" && 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/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 @@ Home Page DSub cannot function without the ability to write to storage - This apps uses location data to get the WIFI SSID when the app is in use. No location data is collected. + 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. No songs -- cgit v1.2.3 From f4edc8f502279fa4eb1a52652c3f57b209202ecf Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Wed, 4 Nov 2020 20:39:18 -0800 Subject: Fix fullscreen layout not actually be fullscreen anymore --- app/src/main/res/layout/abstract_activity.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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">