diff options
author | Alex Ning <chineseperson5@gmail.com> | 2021-07-14 12:47:49 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2021-07-14 12:47:49 +0000 |
commit | e2e7a8cdcd85e016195e71f57e61edcee70f02ca (patch) | |
tree | 1abbdeb720b113fd6d348d391923f601d09dbae0 | |
parent | 200f5839ff3d673b1e87c4d65c984f50c90fb661 (diff) | |
download | infinity-for-reddit-e2e7a8cdcd85e016195e71f57e61edcee70f02ca.tar infinity-for-reddit-e2e7a8cdcd85e016195e71f57e61edcee70f02ca.tar.gz infinity-for-reddit-e2e7a8cdcd85e016195e71f57e61edcee70f02ca.tar.bz2 infinity-for-reddit-e2e7a8cdcd85e016195e71f57e61edcee70f02ca.tar.lz infinity-for-reddit-e2e7a8cdcd85e016195e71f57e61edcee70f02ca.tar.xz infinity-for-reddit-e2e7a8cdcd85e016195e71f57e61edcee70f02ca.tar.zst infinity-for-reddit-e2e7a8cdcd85e016195e71f57e61edcee70f02ca.zip |
Use MediaStore.VOLUME_EXTERNAL_PRIMARY when downloading media.
2 files changed, 2 insertions, 3 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/services/DownloadMediaService.java b/app/src/main/java/ml/docilealligator/infinityforreddit/services/DownloadMediaService.java index a326d81f..e5534ef9 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/services/DownloadMediaService.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/services/DownloadMediaService.java @@ -263,7 +263,7 @@ public class DownloadMediaService extends Service { contentValues.put(MediaStore.MediaColumns.RELATIVE_PATH, destinationFileUriString); contentValues.put(mediaType == EXTRA_MEDIA_TYPE_VIDEO ? MediaStore.Video.Media.IS_PENDING : MediaStore.Images.Media.IS_PENDING, 1); - final Uri contentUri = mediaType == EXTRA_MEDIA_TYPE_VIDEO ? MediaStore.Video.Media.getContentUri(MediaStore.VOLUME_EXTERNAL) : MediaStore.Images.Media.getContentUri(MediaStore.VOLUME_EXTERNAL); + final Uri contentUri = mediaType == EXTRA_MEDIA_TYPE_VIDEO ? MediaStore.Video.Media.getContentUri(MediaStore.VOLUME_EXTERNAL_PRIMARY) : MediaStore.Images.Media.getContentUri(MediaStore.VOLUME_EXTERNAL_PRIMARY); Uri uri = contentResolver.insert(contentUri, contentValues); if (uri == null) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/services/DownloadRedditVideoService.java b/app/src/main/java/ml/docilealligator/infinityforreddit/services/DownloadRedditVideoService.java index f1b9633e..a398871e 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/services/DownloadRedditVideoService.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/services/DownloadRedditVideoService.java @@ -25,7 +25,6 @@ import android.os.Looper; import android.os.Message; import android.os.Process; import android.provider.MediaStore; -import android.util.Log; import androidx.core.app.NotificationCompat; import androidx.core.app.NotificationManagerCompat; @@ -417,7 +416,7 @@ public class DownloadRedditVideoService extends Service { Uri uri = null; try { - final Uri contentUri = MediaStore.Video.Media.getContentUri(MediaStore.VOLUME_EXTERNAL); + final Uri contentUri = MediaStore.Video.Media.getContentUri(MediaStore.VOLUME_EXTERNAL_PRIMARY); uri = contentResolver.insert(contentUri, contentValues); if (uri == null) { |