Fixed crash in dialer if DTMF_TONE_WHEN_DIALING setting isn't found
This commit is contained in:
parent
bfbae245ce
commit
345941781b
1 changed files with 12 additions and 4 deletions
|
@ -67,13 +67,21 @@ class DialerViewModel : LogsUploadViewModel() {
|
|||
|
||||
if (coreContext.core.callsNb == 0) {
|
||||
val contentResolver = coreContext.context.contentResolver
|
||||
if (Settings.System.getInt(contentResolver, Settings.System.DTMF_TONE_WHEN_DIALING) == 1) {
|
||||
try {
|
||||
if (Settings.System.getInt(
|
||||
contentResolver,
|
||||
Settings.System.DTMF_TONE_WHEN_DIALING
|
||||
) == 1
|
||||
) {
|
||||
coreContext.core.playDtmf(key, 1)
|
||||
|
||||
if (vibrator.hasVibrator() && corePreferences.dtmfKeypadVibration) {
|
||||
Compatibility.eventVibration(vibrator)
|
||||
}
|
||||
}
|
||||
} catch (snfe: Settings.SettingNotFoundException) {
|
||||
Log.e("[Dialer] Can't play DTMF: $snfe")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue