Catch exception when looking up ringtone title

pull/2080/head
Alex Baker 2 years ago
parent 1315f59199
commit 2d3d136012

@ -272,7 +272,11 @@ class Notifications : InjectingPreferenceFragment() {
preference.summary = if (uri == default) {
getString(R.string.settings_default)
} else {
RingtoneManager.getRingtone(context, uri)?.getTitle(context)
try {
RingtoneManager.getRingtone(context, uri)?.getTitle(context)
} catch (e: SecurityException) {
uri.toString()
}
}
}
true

Loading…
Cancel
Save