mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-04-25 13:58:32 +00:00
Ignore unmute requests from telecom manager unless user is connected to Android Auto
This commit is contained in:
parent
942e78eede
commit
da848ecc61
1 changed files with 12 additions and 3 deletions
|
|
@ -172,12 +172,21 @@ class TelecomCallControlCallback(
|
||||||
Log.i(
|
Log.i(
|
||||||
"$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]"
|
||||||
)
|
)
|
||||||
// This is to prevent mic not muted when joining conference if user decided to join as muted
|
// Only follow un-mute requests for not outgoing calls (such as joining a conference muted)
|
||||||
if (muted || !LinphoneUtils.isCallOutgoing(callState, false)) {
|
// 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)) {
|
||||||
call.microphoneMuted = muted
|
call.microphoneMuted = muted
|
||||||
coreContext.refreshMicrophoneMuteStateEvent.postValue(Event(true))
|
coreContext.refreshMicrophoneMuteStateEvent.postValue(Event(true))
|
||||||
} else {
|
} else {
|
||||||
Log.w("$TAG Not following unmute request because call is in state [$callState]")
|
if (coreContext.isConnectedToAndroidAuto) {
|
||||||
|
Log.w(
|
||||||
|
"$TAG Not following unmute request because call is in state [$callState]"
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
Log.w(
|
||||||
|
"$TAG Not following unmute request because user isn't connected to Android Auto and call is in state [$callState]"
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.launchIn(scope)
|
}.launchIn(scope)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue