Fixed incoming call ringtone not being stopped when pressing volume keys if TelecomManager is enabled

This commit is contained in:
Sylvain Berfini 2021-12-01 13:15:23 +01:00
parent dc442520ba
commit 051a6fb393
2 changed files with 6 additions and 1 deletions

View file

@ -102,6 +102,11 @@ class NativeCallWrapper(var callId: String) : Connection() {
getCall()?.terminate() ?: selfDestroy()
}
override fun onSilence() {
Log.i("[Connection] Call with id: $callId asked to be silenced")
coreContext.core.stopRinging()
}
private fun getCall(): Call? {
return coreContext.core.getCallByCallid(callId)
}

View file

@ -208,7 +208,7 @@ class TelecomHelper private constructor(context: Context) {
if (call.dir == Call.Dir.Outgoing) {
extras.putString(
EXTRA_CALL_BACK_NUMBER,
call.callLog.fromAddress.asStringUriOnly()
call.remoteAddress.asStringUriOnly()
)
} else {
extras.putParcelable(EXTRA_INCOMING_CALL_ADDRESS, Uri.parse(address.asStringUriOnly()))