mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Fixed mute microphone in waiting room not applied once conference has been joined
This commit is contained in:
parent
1aeb917d62
commit
aa36129053
2 changed files with 13 additions and 4 deletions
|
|
@ -36,6 +36,7 @@ import org.linphone.core.Call
|
|||
import org.linphone.core.CallListenerStub
|
||||
import org.linphone.core.tools.Log
|
||||
import org.linphone.utils.AudioUtils
|
||||
import org.linphone.utils.LinphoneUtils
|
||||
|
||||
class TelecomCallControlCallback(
|
||||
private val call: Call,
|
||||
|
|
@ -143,9 +144,16 @@ class TelecomCallControlCallback(
|
|||
}.launchIn(scope)
|
||||
|
||||
callControl.isMuted.onEach { muted ->
|
||||
Log.i("$TAG We're asked to ${if (muted) "mute" else "unmute"} the call")
|
||||
coreContext.postOnCoreThread {
|
||||
call.microphoneMuted = muted
|
||||
val callState = call.state
|
||||
Log.i(
|
||||
"$TAG We're asked to [${if (muted) "mute" else "unmute"}] the call in state [$callState]"
|
||||
)
|
||||
if (muted || !LinphoneUtils.isCallOutgoing(callState, false)) {
|
||||
call.microphoneMuted = muted
|
||||
} else {
|
||||
Log.w("$TAG Not following unmute request because call is in state [$callState]")
|
||||
}
|
||||
}
|
||||
}.launchIn(scope)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,9 +100,10 @@ class LinphoneUtils {
|
|||
}
|
||||
|
||||
@AnyThread
|
||||
fun isCallOutgoing(callState: Call.State): Boolean {
|
||||
fun isCallOutgoing(callState: Call.State, considerEarlyMedia: Boolean = true): Boolean {
|
||||
return when (callState) {
|
||||
Call.State.OutgoingInit, Call.State.OutgoingProgress, Call.State.OutgoingRinging, Call.State.OutgoingEarlyMedia -> true
|
||||
Call.State.OutgoingInit, Call.State.OutgoingProgress, Call.State.OutgoingRinging -> true
|
||||
Call.State.OutgoingEarlyMedia -> considerEarlyMedia
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue