mirror of
https://github.com/SimpleMobileTools/Simple-Dialer.git
synced 2025-04-03 13:01:49 +02:00
Try to respect in-app dialpad tone preference
This commit is contained in:
parent
b80df57240
commit
004515bc46
@ -364,7 +364,7 @@ class CallActivity : SimpleActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun dialpadPressed(char: Char) {
|
private fun dialpadPressed(char: Char) {
|
||||||
CallManager.keypad(char)
|
CallManager.keypad(this, char)
|
||||||
dialpad_input.addCharacter(char)
|
dialpad_input.addCharacter(char)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
package com.simplemobiletools.dialer.helpers
|
package com.simplemobiletools.dialer.helpers
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
|
import android.content.Context
|
||||||
import android.os.Handler
|
import android.os.Handler
|
||||||
import android.telecom.Call
|
import android.telecom.Call
|
||||||
import android.telecom.InCallService
|
import android.telecom.InCallService
|
||||||
import android.telecom.VideoProfile
|
import android.telecom.VideoProfile
|
||||||
|
import com.simplemobiletools.dialer.extensions.config
|
||||||
import com.simplemobiletools.dialer.extensions.getStateCompat
|
import com.simplemobiletools.dialer.extensions.getStateCompat
|
||||||
import com.simplemobiletools.dialer.extensions.hasCapability
|
import com.simplemobiletools.dialer.extensions.hasCapability
|
||||||
import com.simplemobiletools.dialer.extensions.isConference
|
import com.simplemobiletools.dialer.extensions.isConference
|
||||||
@ -168,11 +170,15 @@ class CallManager {
|
|||||||
|
|
||||||
fun getState() = getPrimaryCall()?.getStateCompat()
|
fun getState() = getPrimaryCall()?.getStateCompat()
|
||||||
|
|
||||||
fun keypad(c: Char) {
|
fun keypad(context: Context, char: Char) {
|
||||||
call?.playDtmfTone(c)
|
call?.playDtmfTone(char)
|
||||||
Handler().postDelayed({
|
if (context.config.dialpadBeeps) {
|
||||||
|
Handler().postDelayed({
|
||||||
|
call?.stopDtmfTone()
|
||||||
|
}, DIALPAD_TONE_LENGTH_MS)
|
||||||
|
} else {
|
||||||
call?.stopDtmfTone()
|
call?.stopDtmfTone()
|
||||||
}, DIALPAD_TONE_LENGTH_MS)
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user