mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-01-01 11:07:34 +01:00
fix a crash caused by no permission accessing the default notification sound
This commit is contained in:
parent
9ef8fd775b
commit
12892b0300
@ -53,6 +53,11 @@
|
||||
android:label="@string/customize_colors"
|
||||
android:parentActivityName=".activities.SettingsActivity"/>
|
||||
|
||||
<activity
|
||||
android:name="com.simplemobiletools.commons.activities.LicenseActivity"
|
||||
android:label="@string/third_party_licences"
|
||||
android:parentActivityName="com.simplemobiletools.commons.activities.AboutActivity"/>
|
||||
|
||||
<activity
|
||||
android:name=".activities.DayActivity"
|
||||
android:label="@string/details"
|
||||
@ -63,11 +68,6 @@
|
||||
android:label="@string/event"
|
||||
android:parentActivityName=".activities.DayActivity"/>
|
||||
|
||||
<activity
|
||||
android:name="com.simplemobiletools.commons.activities.LicenseActivity"
|
||||
android:label="@string/third_party_licences"
|
||||
android:parentActivityName="com.simplemobiletools.commons.activities.AboutActivity"/>
|
||||
|
||||
<activity
|
||||
android:name=".activities.SettingsActivity"
|
||||
android:label="@string/settings"
|
||||
|
@ -51,5 +51,11 @@ class Config(context: Context) : BaseConfig(context) {
|
||||
prefs.edit().putInt(REMINDER_MINUTES, mins).apply()
|
||||
}
|
||||
|
||||
fun getDefaultNotificationSound() = RingtoneManager.getActualDefaultRingtoneUri(context, RingtoneManager.TYPE_NOTIFICATION)?.toString() ?: ""
|
||||
fun getDefaultNotificationSound(): String {
|
||||
try {
|
||||
return RingtoneManager.getActualDefaultRingtoneUri(context, RingtoneManager.TYPE_NOTIFICATION)?.toString() ?: ""
|
||||
} catch (e: Exception) {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user