mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
fix a crash caused by no permission accessing the default notification sound
This commit is contained in:
@@ -53,6 +53,11 @@
|
|||||||
android:label="@string/customize_colors"
|
android:label="@string/customize_colors"
|
||||||
android:parentActivityName=".activities.SettingsActivity"/>
|
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
|
<activity
|
||||||
android:name=".activities.DayActivity"
|
android:name=".activities.DayActivity"
|
||||||
android:label="@string/details"
|
android:label="@string/details"
|
||||||
@@ -63,11 +68,6 @@
|
|||||||
android:label="@string/event"
|
android:label="@string/event"
|
||||||
android:parentActivityName=".activities.DayActivity"/>
|
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
|
<activity
|
||||||
android:name=".activities.SettingsActivity"
|
android:name=".activities.SettingsActivity"
|
||||||
android:label="@string/settings"
|
android:label="@string/settings"
|
||||||
|
@@ -51,5 +51,11 @@ class Config(context: Context) : BaseConfig(context) {
|
|||||||
prefs.edit().putInt(REMINDER_MINUTES, mins).apply()
|
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 ""
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user