mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Prevent crash if DMTF setting doesn't exists (Samsung A51)
This commit is contained in:
parent
da5ce721dc
commit
cb1e8ecc01
1 changed files with 13 additions and 8 deletions
|
|
@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue