Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,12 @@ fun Context.storeNewYourAlarmSound(resultData: Intent): AlarmSound {
baseConfig.yourAlarmSounds = Gson().toJson(yourAlarmSounds)

val takeFlags = Intent.FLAG_GRANT_READ_URI_PERMISSION
contentResolver.takePersistableUriPermission(uri, takeFlags)
try {
contentResolver.takePersistableUriPermission(uri, takeFlags)
} catch (_: SecurityException) {
// some file managers return a content uri without a persistable
// permission grant, which would otherwise crash the app
}

return newAlarmSound
}
Expand Down
Loading