Disable DTMF sound on dialer if Settings.System.DTMF_TONE_WHEN_DIALING says so
This commit is contained in:
parent
0100536e2e
commit
fe1fef5209
1 changed files with 6 additions and 1 deletions
|
@ -19,6 +19,7 @@
|
|||
*/
|
||||
package org.linphone.activities.main.dialer.viewmodels
|
||||
|
||||
import android.provider.Settings
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.ViewModel
|
||||
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||
|
@ -45,9 +46,13 @@ class DialerViewModel : ViewModel() {
|
|||
override fun handleClick(key: Char) {
|
||||
enteredUri.value += key.toString()
|
||||
if (coreContext.core.callsNb == 0) {
|
||||
val contentResolver = coreContext.context.contentResolver
|
||||
val dtmfSetting = Settings.System.getInt(contentResolver, Settings.System.DTMF_TONE_WHEN_DIALING)
|
||||
if (dtmfSetting == 1) {
|
||||
coreContext.core.playDtmf(key, 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun handleLongClick(key: Char): Boolean {
|
||||
if (key == '1') {
|
||||
|
|
Loading…
Reference in a new issue