mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-05-03 15:26:27 +00:00
Prevent crash if DMTF setting doesn't exists (Samsung A51)
This commit is contained in:
parent
71e1734ca0
commit
614ac7f9cf
1 changed files with 13 additions and 8 deletions
|
|
@ -30,6 +30,7 @@ import android.os.Handler
|
||||||
import android.os.HandlerThread
|
import android.os.HandlerThread
|
||||||
import android.os.Looper
|
import android.os.Looper
|
||||||
import android.provider.Settings
|
import android.provider.Settings
|
||||||
|
import android.provider.Settings.SettingNotFoundException
|
||||||
import androidx.annotation.AnyThread
|
import androidx.annotation.AnyThread
|
||||||
import androidx.annotation.UiThread
|
import androidx.annotation.UiThread
|
||||||
import androidx.annotation.WorkerThread
|
import androidx.annotation.WorkerThread
|
||||||
|
|
@ -896,14 +897,18 @@ class CoreContext
|
||||||
|
|
||||||
@WorkerThread
|
@WorkerThread
|
||||||
fun playDtmf(character: Char, duration: Int = 200, ignoreSystemPolicy: Boolean = false) {
|
fun playDtmf(character: Char, duration: Int = 200, ignoreSystemPolicy: Boolean = false) {
|
||||||
if (ignoreSystemPolicy || Settings.System.getInt(
|
try {
|
||||||
context.contentResolver,
|
if (ignoreSystemPolicy || Settings.System.getInt(
|
||||||
Settings.System.DTMF_TONE_WHEN_DIALING
|
context.contentResolver,
|
||||||
) != 0
|
Settings.System.DTMF_TONE_WHEN_DIALING
|
||||||
) {
|
) != 0
|
||||||
core.playDtmf(character, duration)
|
) {
|
||||||
} else {
|
core.playDtmf(character, duration)
|
||||||
Log.w("$TAG Numpad DTMF tones are disabled in system settings, not playing them")
|
} 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