Enable proximity sensor for outgoing calls if video is disabled

This commit is contained in:
Sylvain Berfini 2024-05-28 17:24:54 +02:00
parent eea978d8e8
commit 6d099a3075

View file

@ -411,8 +411,11 @@ class CurrentCallViewModel @UiThread constructor() : GenericViewModel() {
private fun updateProximitySensor() {
if (::currentCall.isInitialized) {
val callState = currentCall.state
if (LinphoneUtils.isCallIncoming(callState) || LinphoneUtils.isCallOutgoing(callState)) {
if (LinphoneUtils.isCallIncoming(callState)) {
proximitySensorEnabled.postValue(false)
} else if (LinphoneUtils.isCallOutgoing(callState)) {
val videoEnabled = currentCall.params.isVideoEnabled
proximitySensorEnabled.postValue(!videoEnabled)
} else {
if (isSendingVideo.value == true || isReceivingVideo.value == true) {
proximitySensorEnabled.postValue(false)