Fixed File deletion on A10

This commit is contained in:
Prathamesh More 2021-11-23 11:17:26 +05:30
parent ad81ceb592
commit e187b13912
2 changed files with 3 additions and 3 deletions

View file

@ -90,9 +90,9 @@ class DeleteSongsDialog : DialogFragment() {
if ((songs.size == 1) && MusicPlayerRemote.isPlaying(songs[0])) { if ((songs.size == 1) && MusicPlayerRemote.isPlaying(songs[0])) {
MusicPlayerRemote.playNextSong() MusicPlayerRemote.playNextSong()
} }
if (VersionUtils.hasQ()) { if (VersionUtils.hasR()) {
dismiss() dismiss()
MusicUtil.deleteTracksQ(requireActivity(), songs) MusicUtil.deleteTracksR(requireActivity(), songs)
reloadTabs() reloadTabs()
} else if (!SAFUtil.isSAFRequiredForSongs(songs)) { } else if (!SAFUtil.isSAFRequiredForSongs(songs)) {
CoroutineScope(Dispatchers.IO).launch { CoroutineScope(Dispatchers.IO).launch {

View file

@ -525,7 +525,7 @@ object MusicUtil : KoinComponent {
} }
@RequiresApi(Build.VERSION_CODES.R) @RequiresApi(Build.VERSION_CODES.R)
fun deleteTracksQ(activity: Activity, songs: List<Song>) { fun deleteTracksR(activity: Activity, songs: List<Song>) {
val pendingIntent = MediaStore.createDeleteRequest(activity.contentResolver, songs.map { val pendingIntent = MediaStore.createDeleteRequest(activity.contentResolver, songs.map {
getSongFileUri(it.id) getSongFileUri(it.id)
}) })