add a null check to default ringtone uri
This commit is contained in:
parent
a1ed41944e
commit
0d37b0f100
|
@ -40,7 +40,7 @@ class Config(val context: Context) {
|
||||||
set(vibrate) = mPrefs.edit().putBoolean(VIBRATE, vibrate).apply()
|
set(vibrate) = mPrefs.edit().putBoolean(VIBRATE, vibrate).apply()
|
||||||
|
|
||||||
var reminderSound: String
|
var reminderSound: String
|
||||||
get() = mPrefs.getString(REMINDER_SOUND, RingtoneManager.getActualDefaultRingtoneUri(context, RingtoneManager.TYPE_NOTIFICATION).toString())
|
get() = mPrefs.getString(REMINDER_SOUND, getDefaultNotificationSound())
|
||||||
set(path) = mPrefs.edit().putString(REMINDER_SOUND, path).apply()
|
set(path) = mPrefs.edit().putString(REMINDER_SOUND, path).apply()
|
||||||
|
|
||||||
var storedView: Int
|
var storedView: Int
|
||||||
|
@ -64,4 +64,6 @@ class Config(val context: Context) {
|
||||||
defaultReminderType = REMINDER_AT_START
|
defaultReminderType = REMINDER_AT_START
|
||||||
mPrefs.edit().putInt(REMINDER_MINUTES, mins).apply()
|
mPrefs.edit().putInt(REMINDER_MINUTES, mins).apply()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getDefaultNotificationSound() = RingtoneManager.getActualDefaultRingtoneUri(context, RingtoneManager.TYPE_NOTIFICATION)?.toString() ?: ""
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue