From e187b1391226e4ff694f2f2776a0a615791ebfd1 Mon Sep 17 00:00:00 2001 From: Prathamesh More Date: Tue, 23 Nov 2021 11:17:26 +0530 Subject: [PATCH] Fixed File deletion on A10 --- .../code/name/monkey/retromusic/dialogs/DeleteSongsDialog.kt | 4 ++-- .../main/java/code/name/monkey/retromusic/util/MusicUtil.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/code/name/monkey/retromusic/dialogs/DeleteSongsDialog.kt b/app/src/main/java/code/name/monkey/retromusic/dialogs/DeleteSongsDialog.kt index dc643849..ddc586b9 100644 --- a/app/src/main/java/code/name/monkey/retromusic/dialogs/DeleteSongsDialog.kt +++ b/app/src/main/java/code/name/monkey/retromusic/dialogs/DeleteSongsDialog.kt @@ -90,9 +90,9 @@ class DeleteSongsDialog : DialogFragment() { if ((songs.size == 1) && MusicPlayerRemote.isPlaying(songs[0])) { MusicPlayerRemote.playNextSong() } - if (VersionUtils.hasQ()) { + if (VersionUtils.hasR()) { dismiss() - MusicUtil.deleteTracksQ(requireActivity(), songs) + MusicUtil.deleteTracksR(requireActivity(), songs) reloadTabs() } else if (!SAFUtil.isSAFRequiredForSongs(songs)) { CoroutineScope(Dispatchers.IO).launch { diff --git a/app/src/main/java/code/name/monkey/retromusic/util/MusicUtil.kt b/app/src/main/java/code/name/monkey/retromusic/util/MusicUtil.kt index d9a66e21..67198aae 100644 --- a/app/src/main/java/code/name/monkey/retromusic/util/MusicUtil.kt +++ b/app/src/main/java/code/name/monkey/retromusic/util/MusicUtil.kt @@ -525,7 +525,7 @@ object MusicUtil : KoinComponent { } @RequiresApi(Build.VERSION_CODES.R) - fun deleteTracksQ(activity: Activity, songs: List) { + fun deleteTracksR(activity: Activity, songs: List) { val pendingIntent = MediaStore.createDeleteRequest(activity.contentResolver, songs.map { getSongFileUri(it.id) })