aboutsummaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2020-09-12 11:54:17 -0700
committerScott Jackson <daneren2005@gmail.com>2020-09-12 11:54:17 -0700
commit976ed49ec199035718285a3d5e0bc76fa9ba849a (patch)
treeaa99bad131ff383a592666a28593ed6c8a928ec6 /app/src
parent04f1c5ae49c518ca38b51a3074e18cc4917117ff (diff)
downloaddsub-976ed49ec199035718285a3d5e0bc76fa9ba849a.tar.gz
dsub-976ed49ec199035718285a3d5e0bc76fa9ba849a.tar.bz2
dsub-976ed49ec199035718285a3d5e0bc76fa9ba849a.zip
Go back to just using getExternalFilesDirs on Android 11+
getExternalMediaDirs was depreciated in Android 11 since they want people to just contribute to MediaStore directly instead: https://developer.android.com/reference/android/content/Context#getExternalMediaDirs()
Diffstat (limited to 'app/src')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/util/FileUtil.java2
-rw-r--r--app/src/main/java/github/daneren2005/dsub/view/CacheLocationPreference.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/util/FileUtil.java b/app/src/main/java/github/daneren2005/dsub/util/FileUtil.java
index fb395c77..e581173b 100644
--- a/app/src/main/java/github/daneren2005/dsub/util/FileUtil.java
+++ b/app/src/main/java/github/daneren2005/dsub/util/FileUtil.java
@@ -453,7 +453,7 @@ public class FileUtil {
public static File getDefaultMusicDirectory(Context context) {
if(DEFAULT_MUSIC_DIR == null) {
File[] dirs;
- if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
dirs = context.getExternalMediaDirs();
} else {
dirs = ContextCompat.getExternalFilesDirs(context, null);
diff --git a/app/src/main/java/github/daneren2005/dsub/view/CacheLocationPreference.java b/app/src/main/java/github/daneren2005/dsub/view/CacheLocationPreference.java
index 35ce71bc..002f0245 100644
--- a/app/src/main/java/github/daneren2005/dsub/view/CacheLocationPreference.java
+++ b/app/src/main/java/github/daneren2005/dsub/view/CacheLocationPreference.java
@@ -67,7 +67,7 @@ public class CacheLocationPreference extends EditTextPreference {
Button externalLocation = (Button) cacheButtonsWrapper.findViewById(R.id.location_external);
File[] dirs;
- if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
dirs = context.getExternalMediaDirs();
} else {
dirs = ContextCompat.getExternalFilesDirs(context, null);