diff --git a/app/src/main/java/org/linphone/core/CoreContext.kt b/app/src/main/java/org/linphone/core/CoreContext.kt index ca69874cb..70254af20 100644 --- a/app/src/main/java/org/linphone/core/CoreContext.kt +++ b/app/src/main/java/org/linphone/core/CoreContext.kt @@ -30,6 +30,7 @@ import android.os.Handler import android.os.HandlerThread import android.os.Looper import android.provider.Settings +import android.provider.Settings.SettingNotFoundException import androidx.annotation.AnyThread import androidx.annotation.UiThread import androidx.annotation.WorkerThread @@ -896,14 +897,18 @@ class CoreContext @WorkerThread fun playDtmf(character: Char, duration: Int = 200, ignoreSystemPolicy: Boolean = false) { - if (ignoreSystemPolicy || Settings.System.getInt( - context.contentResolver, - Settings.System.DTMF_TONE_WHEN_DIALING - ) != 0 - ) { - core.playDtmf(character, duration) - } else { - Log.w("$TAG Numpad DTMF tones are disabled in system settings, not playing them") + try { + if (ignoreSystemPolicy || Settings.System.getInt( + context.contentResolver, + Settings.System.DTMF_TONE_WHEN_DIALING + ) != 0 + ) { + core.playDtmf(character, duration) + } else { + Log.w("$TAG Numpad DTMF tones are disabled in system settings, not playing them") + } + } catch (snfe: SettingNotFoundException) { + Log.e("$TAG DTMF_TONE_WHEN_DIALING system setting not found: $snfe") } }