mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 03:18:06 +00:00
Fixed proximity sensor not disabled during incoming call
This commit is contained in:
parent
cce13828d9
commit
0206753d78
1 changed files with 9 additions and 7 deletions
|
|
@ -555,6 +555,13 @@ class ControlsViewModel : ViewModel() {
|
|||
}
|
||||
|
||||
private fun shouldProximitySensorBeEnabled(): Boolean {
|
||||
if (forceDisableProximitySensor.value == true) {
|
||||
Log.i(
|
||||
"[Call Controls] Forcing proximity sensor to be disabled (usually in incoming/outgoing call fragments)"
|
||||
)
|
||||
return false
|
||||
}
|
||||
|
||||
val currentCall = coreContext.core.currentCall ?: coreContext.core.calls.firstOrNull()
|
||||
if (currentCall != null) {
|
||||
when (val state = currentCall.state) {
|
||||
|
|
@ -574,11 +581,7 @@ class ControlsViewModel : ViewModel() {
|
|||
}
|
||||
}
|
||||
|
||||
if (forceDisableProximitySensor.value == true) {
|
||||
Log.i(
|
||||
"[Call Controls] Forcing proximity sensor to be disabled (usually in incoming/outgoing call fragments)"
|
||||
)
|
||||
} else if (isVideoEnabled.value == true) {
|
||||
if (isVideoEnabled.value == true) {
|
||||
Log.i(
|
||||
"[Call Controls] Active call current params says video is enabled, proximity sensor will be disabled"
|
||||
)
|
||||
|
|
@ -588,8 +591,7 @@ class ControlsViewModel : ViewModel() {
|
|||
)
|
||||
}
|
||||
|
||||
return forceDisableProximitySensor.value == false &&
|
||||
!(isVideoEnabled.value ?: false) &&
|
||||
return !(isVideoEnabled.value ?: false) &&
|
||||
!(nonEarpieceOutputAudioDevice.value ?: false)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue