mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 03:18:06 +00:00
Fixed muted call if Telecom Manager requested a quick mute/unmute
This commit is contained in:
parent
332828dc7c
commit
ada6f35d92
1 changed files with 6 additions and 2 deletions
|
|
@ -57,6 +57,8 @@ class TelecomCallControlCallback(
|
||||||
private var endpointUpdateRequestFromLinphone: Boolean = false
|
private var endpointUpdateRequestFromLinphone: Boolean = false
|
||||||
private var latestLinphoneRequestedEndpoint: CallEndpointCompat? = null
|
private var latestLinphoneRequestedEndpoint: CallEndpointCompat? = null
|
||||||
|
|
||||||
|
private var mutedByTelecomManager = false
|
||||||
|
|
||||||
private val callListener = object : CallListenerStub() {
|
private val callListener = object : CallListenerStub() {
|
||||||
@WorkerThread
|
@WorkerThread
|
||||||
override fun onStateChanged(call: Call, state: Call.State?, message: String) {
|
override fun onStateChanged(call: Call, state: Call.State?, message: String) {
|
||||||
|
|
@ -201,8 +203,10 @@ class TelecomCallControlCallback(
|
||||||
"$TAG We're asked to [${if (muted) "mute" else "unmute"}] the call in state [$callState]"
|
"$TAG We're asked to [${if (muted) "mute" else "unmute"}] the call in state [$callState]"
|
||||||
)
|
)
|
||||||
// Only follow un-mute requests for not outgoing calls (such as joining a conference muted)
|
// Only follow un-mute requests for not outgoing calls (such as joining a conference muted)
|
||||||
// and if connected to Android Auto that has a way to let user mute/unmute from the car directly.
|
// and if connected to Android Auto that has a way to let user mute/unmute from the car directly
|
||||||
if (muted || (!LinphoneUtils.isCallOutgoing(callState, false) && coreContext.isConnectedToAndroidAuto)) {
|
// or if we muted the call previously following Telecom Manager request.
|
||||||
|
if (muted || mutedByTelecomManager || (!LinphoneUtils.isCallOutgoing(callState, false) && coreContext.isConnectedToAndroidAuto)) {
|
||||||
|
mutedByTelecomManager = muted
|
||||||
call.microphoneMuted = muted
|
call.microphoneMuted = muted
|
||||||
coreContext.refreshMicrophoneMuteStateEvent.postValue(Event(true))
|
coreContext.refreshMicrophoneMuteStateEvent.postValue(Event(true))
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue