mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Fixed in-call numpad not sending DTMFs + prevent keyboard to open when touching numpad area
This commit is contained in:
parent
4628560411
commit
6308d66eb6
5 changed files with 13 additions and 4 deletions
|
|
@ -797,8 +797,12 @@ class CoreContext @UiThread constructor(val context: Context) : HandlerThread("C
|
|||
}
|
||||
|
||||
@WorkerThread
|
||||
fun playDtmf(character: Char, duration: Int = 200) {
|
||||
if (Settings.System.getInt(context.contentResolver, Settings.System.DTMF_TONE_WHEN_DIALING) != 0) {
|
||||
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")
|
||||
|
|
|
|||
|
|
@ -525,6 +525,7 @@ class CurrentCallViewModel @UiThread constructor() : GenericViewModel() {
|
|||
}
|
||||
|
||||
numpadModel = NumpadModel(
|
||||
true,
|
||||
{ digit -> // onDigitClicked
|
||||
appendDigitToSearchBarEvent.value = Event(digit)
|
||||
coreContext.postOnCoreThread {
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import org.linphone.LinphoneApplication.Companion.coreContext
|
|||
import org.linphone.core.tools.Log
|
||||
|
||||
open class NumpadModel @UiThread constructor(
|
||||
private val inCallNumpad: Boolean,
|
||||
private val onDigitClicked: (value: String) -> (Unit),
|
||||
private val onBackspaceClicked: () -> (Unit),
|
||||
private val onCallClicked: () -> (Unit),
|
||||
|
|
@ -42,8 +43,8 @@ open class NumpadModel @UiThread constructor(
|
|||
onDigitClicked.invoke(value)
|
||||
|
||||
if (value.isNotEmpty()) {
|
||||
coreContext.postOnCoreThread { core ->
|
||||
coreContext.playDtmf(value[0])
|
||||
coreContext.postOnCoreThread {
|
||||
coreContext.playDtmf(value[0], ignoreSystemPolicy = inCallNumpad)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,6 +125,7 @@ class StartCallViewModel @UiThread constructor() : AddressSelectionViewModel() {
|
|||
init {
|
||||
isNumpadVisible.value = false
|
||||
numpadModel = NumpadModel(
|
||||
false,
|
||||
{ digit ->
|
||||
// onDigitClicked
|
||||
appendDigitToSearchBarEvent.value = Event(digit)
|
||||
|
|
|
|||
|
|
@ -46,6 +46,8 @@
|
|||
android:textSize="30sp"
|
||||
android:text="@{model.digits, default=`0123456789`}"
|
||||
android:background="@color/transparent_color"
|
||||
android:enabled="false"
|
||||
android:inputType="number|phone"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="start"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue