Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cc205689 authored by tibbi's avatar tibbi
Browse files

always use "Alarm" as the default alarm sound title

parent a48d160e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ buildscript {
        propMinSdkVersion = 16
        propTargetSdkVersion = propCompileSdkVersion
        propVersionCode = 1
        propVersionName = '3.17.12'
        propVersionName = '3.17.13'
        kotlin_version = '1.2.31'
        support_libs = '27.1.0'
    }
+1 −1
Original line number Diff line number Diff line
@@ -789,7 +789,7 @@ fun BaseSimpleActivity.getAlarmSounds(type: Int, callback: (ArrayList<AlarmSound

    try {
        val cursor = manager.cursor
        val defaultAlarm = getDefaultAlarmSound(type, getString(R.string.alarm))
        val defaultAlarm = getDefaultAlarmSound(type)
        alarms.add(defaultAlarm)

        var curId = 1
+3 −3
Original line number Diff line number Diff line
@@ -451,10 +451,10 @@ fun Context.getFormattedSeconds(seconds: Int, showBefore: Boolean = true) = when

fun Context.getDefaultAlarmUri(type: Int) = RingtoneManager.getDefaultUri(if (type == ALARM_SOUND_TYPE_NOTIFICATION) RingtoneManager.TYPE_NOTIFICATION else RingtoneManager.TYPE_ALARM)

fun Context.getDefaultAlarmTitle(type: Int, defaultTitle: String) = RingtoneManager.getRingtone(this, getDefaultAlarmUri(type))?.getTitle(this)
        ?: defaultTitle
fun Context.getDefaultAlarmTitle(type: Int) = RingtoneManager.getRingtone(this, getDefaultAlarmUri(type))?.getTitle(this)
        ?: getString(R.string.alarm)

fun Context.getDefaultAlarmSound(type: Int, defaultTitle: String) = AlarmSound(0, getDefaultAlarmTitle(type, defaultTitle), getDefaultAlarmUri(type).toString())
fun Context.getDefaultAlarmSound(type: Int) = AlarmSound(0, getDefaultAlarmTitle(type), getDefaultAlarmUri(type).toString())

fun Context.grantReadUriPermission(uriString: String) {
    try {