From 68eb9fe2a9227f8a7b52b6516d60f22826dca5c3 Mon Sep 17 00:00:00 2001 From: Juha Heinanen Date: Mon, 20 Dec 2021 16:54:22 +0200 Subject: [PATCH] Disable also dtmd input field when call is put onhold by peer --- .../kotlin/com/tutpro/baresip/MainActivity.kt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app/src/main/kotlin/com/tutpro/baresip/MainActivity.kt b/app/src/main/kotlin/com/tutpro/baresip/MainActivity.kt index 36b7f35c..c6f74499 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/MainActivity.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/MainActivity.kt @@ -1763,13 +1763,6 @@ class MainActivity : AppCompatActivity() { } else { holdButton.setImageResource(R.drawable.hold) } - dtmf.isEnabled = true - dtmf.requestFocus() - if (resources.configuration.orientation == ORIENTATION_PORTRAIT) - imm.showSoftInput(dtmf, InputMethodManager.SHOW_IMPLICIT) - if (dtmfWatcher != null) dtmf.removeTextChangedListener(dtmfWatcher) - dtmfWatcher = call.dtmfWatcher - dtmf.addTextChangedListener(dtmfWatcher) callUri.inputType = InputType.TYPE_CLASS_PHONE dialpadButton.setImageResource(R.drawable.dialpad_on) dialpadButton.tag = "on" @@ -1778,11 +1771,19 @@ class MainActivity : AppCompatActivity() { callControl.visibility = View.VISIBLE if (call.held) { imm.hideSoftInputFromWindow(dtmf.windowToken, 0) + dtmf.isEnabled = false Handler(Looper.getMainLooper()).postDelayed({ onHoldNotice.visibility = View.VISIBLE }, 250) } else { + dtmf.isEnabled = true + dtmf.requestFocus() onHoldNotice.visibility = View.GONE + if (resources.configuration.orientation == ORIENTATION_PORTRAIT) + imm.showSoftInput(dtmf, InputMethodManager.SHOW_IMPLICIT) + if (dtmfWatcher != null) dtmf.removeTextChangedListener(dtmfWatcher) + dtmfWatcher = call.dtmfWatcher + dtmf.addTextChangedListener(dtmfWatcher) } } }