Fixed incoming/outgoing call header overlapping system status bar

This commit is contained in:
Sylvain Berfini 2024-09-02 16:50:00 +02:00
parent 95c4106bd0
commit ace4caca3f
2 changed files with 44 additions and 44 deletions

View file

@ -272,7 +272,7 @@ class CurrentCallViewModel @UiThread constructor() : GenericViewModel() {
Log.i("$TAG Call [${call.remoteAddress.asStringUriOnly()}] state changed [$state]") Log.i("$TAG Call [${call.remoteAddress.asStringUriOnly()}] state changed [$state]")
if (LinphoneUtils.isCallOutgoing(call.state)) { if (LinphoneUtils.isCallOutgoing(call.state)) {
isVideoEnabled.postValue(call.params.isVideoEnabled) isVideoEnabled.postValue(call.params.isVideoEnabled)
updateVideoDirection(call.currentParams.videoDirection) updateVideoDirection(call.params.videoDirection)
} else if (LinphoneUtils.isCallEnding(call.state)) { } else if (LinphoneUtils.isCallEnding(call.state)) {
// If current call is being terminated but there is at least one other call, switch // If current call is being terminated but there is at least one other call, switch
val core = call.core val core = call.core
@ -1069,10 +1069,11 @@ class CurrentCallViewModel @UiThread constructor() : GenericViewModel() {
if (LinphoneUtils.isCallOutgoing(call.state)) { if (LinphoneUtils.isCallOutgoing(call.state)) {
isVideoEnabled.postValue(call.params.isVideoEnabled) isVideoEnabled.postValue(call.params.isVideoEnabled)
updateVideoDirection(call.params.videoDirection)
} else { } else {
isVideoEnabled.postValue(call.currentParams.isVideoEnabled) isVideoEnabled.postValue(call.currentParams.isVideoEnabled)
}
updateVideoDirection(call.currentParams.videoDirection) updateVideoDirection(call.currentParams.videoDirection)
}
if (ActivityCompat.checkSelfPermission( if (ActivityCompat.checkSelfPermission(
coreContext.context, coreContext.context,
@ -1190,6 +1191,11 @@ class CurrentCallViewModel @UiThread constructor() : GenericViewModel() {
@WorkerThread @WorkerThread
private fun updateVideoDirection(direction: MediaDirection) { private fun updateVideoDirection(direction: MediaDirection) {
val state = currentCall.state
if (state != Call.State.StreamsRunning) {
return
}
val isSending = direction == MediaDirection.SendRecv || direction == MediaDirection.SendOnly val isSending = direction == MediaDirection.SendRecv || direction == MediaDirection.SendOnly
val isReceiving = direction == MediaDirection.SendRecv || direction == MediaDirection.RecvOnly val isReceiving = direction == MediaDirection.SendRecv || direction == MediaDirection.RecvOnly

View file

@ -13,16 +13,12 @@
type="org.linphone.ui.call.viewmodel.CallsViewModel" /> type="org.linphone.ui.call.viewmodel.CallsViewModel" />
</data> </data>
<androidx.coordinatorlayout.widget.CoordinatorLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:keepScreenOn="true" android:keepScreenOn="true"
tools:context=".ui.call.CallActivity"> tools:context=".ui.call.CallActivity">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<include <include
android:id="@+id/other_calls_top_bar" android:id="@+id/other_calls_top_bar"
layout="@layout/call_activity_other_calls_top_bar" layout="@layout/call_activity_other_calls_top_bar"
@ -62,6 +58,4 @@
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout> </layout>