[Ringtone] Fixed Ringtone crash on A11+
This commit is contained in:
parent
30bc178b86
commit
36c94a9813
1 changed files with 0 additions and 9 deletions
|
@ -14,7 +14,6 @@
|
||||||
|
|
||||||
package code.name.monkey.retromusic.util
|
package code.name.monkey.retromusic.util
|
||||||
|
|
||||||
import android.content.ContentValues
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
|
@ -32,14 +31,6 @@ class RingtoneManager(val context: Context) {
|
||||||
fun setRingtone(song: Song) {
|
fun setRingtone(song: Song) {
|
||||||
val resolver = context.contentResolver
|
val resolver = context.contentResolver
|
||||||
val uri = getSongFileUri(song.id)
|
val uri = getSongFileUri(song.id)
|
||||||
try {
|
|
||||||
val values = ContentValues(2)
|
|
||||||
values.put(MediaStore.Audio.AudioColumns.IS_RINGTONE, "1")
|
|
||||||
values.put(MediaStore.Audio.AudioColumns.IS_ALARM, "1")
|
|
||||||
resolver.update(uri, values, null, null)
|
|
||||||
} catch (ignored: UnsupportedOperationException) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
val cursor = resolver.query(
|
val cursor = resolver.query(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue