mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-04-17 21:38:29 +00:00
Fixed UI not updated when merging calls into a local conference
This commit is contained in:
parent
29343f8887
commit
ae818507aa
6 changed files with 26 additions and 14 deletions
1
.idea/misc.xml
generated
1
.idea/misc.xml
generated
|
|
@ -1,4 +1,3 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
|
||||||
|
|
|
||||||
|
|
@ -540,10 +540,10 @@ class CallActivity : GenericActivity() {
|
||||||
}
|
}
|
||||||
R.id.callsListFragment -> {
|
R.id.callsListFragment -> {
|
||||||
if (notInConference) {
|
if (notInConference) {
|
||||||
Log.i("$TAG Going calls list fragment to active call fragment")
|
Log.i("$TAG Going from calls list fragment to active call fragment")
|
||||||
CallsListFragmentDirections.actionCallsListFragmentToActiveCallFragment()
|
CallsListFragmentDirections.actionCallsListFragmentToActiveCallFragment()
|
||||||
} else {
|
} else {
|
||||||
Log.i("$TAG Going calls list fragment to conference fragment")
|
Log.i("$TAG Going from calls list fragment to conference fragment")
|
||||||
CallsListFragmentDirections.actionCallsListFragmentToActiveConferenceCallFragment()
|
CallsListFragmentDirections.actionCallsListFragmentToActiveConferenceCallFragment()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -298,6 +298,7 @@ class ConferenceViewModel
|
||||||
@WorkerThread
|
@WorkerThread
|
||||||
fun destroy() {
|
fun destroy() {
|
||||||
isCurrentCallInConference.postValue(false)
|
isCurrentCallInConference.postValue(false)
|
||||||
|
|
||||||
if (::conference.isInitialized) {
|
if (::conference.isInitialized) {
|
||||||
conference.removeListener(conferenceListener)
|
conference.removeListener(conferenceListener)
|
||||||
participantDevices.value.orEmpty().forEach(ConferenceParticipantDeviceModel::destroy)
|
participantDevices.value.orEmpty().forEach(ConferenceParticipantDeviceModel::destroy)
|
||||||
|
|
@ -307,6 +308,15 @@ class ConferenceViewModel
|
||||||
@WorkerThread
|
@WorkerThread
|
||||||
fun configureFromCall(call: Call) {
|
fun configureFromCall(call: Call) {
|
||||||
val conf = call.conference ?: return
|
val conf = call.conference ?: return
|
||||||
|
val confSubject = conf.subjectUtf8.orEmpty()
|
||||||
|
Log.i(
|
||||||
|
"$TAG Configuring conference with subject [$confSubject] from call [${call.callLog.callId}]"
|
||||||
|
)
|
||||||
|
configure(conf)
|
||||||
|
}
|
||||||
|
|
||||||
|
@WorkerThread
|
||||||
|
private fun configure(conf: Conference) {
|
||||||
if (::conference.isInitialized) {
|
if (::conference.isInitialized) {
|
||||||
conference.removeListener(conferenceListener)
|
conference.removeListener(conferenceListener)
|
||||||
}
|
}
|
||||||
|
|
@ -314,6 +324,7 @@ class ConferenceViewModel
|
||||||
isCurrentCallInConference.postValue(true)
|
isCurrentCallInConference.postValue(true)
|
||||||
conference = conf
|
conference = conf
|
||||||
conference.addListener(conferenceListener)
|
conference.addListener(conferenceListener)
|
||||||
|
val core = conference.core
|
||||||
|
|
||||||
val isIn = conference.isIn
|
val isIn = conference.isIn
|
||||||
val state = conf.state
|
val state = conf.state
|
||||||
|
|
@ -331,9 +342,6 @@ class ConferenceViewModel
|
||||||
isConversationAvailable.postValue(chatEnabled)
|
isConversationAvailable.postValue(chatEnabled)
|
||||||
|
|
||||||
val confSubject = conference.subjectUtf8.orEmpty()
|
val confSubject = conference.subjectUtf8.orEmpty()
|
||||||
Log.i(
|
|
||||||
"$TAG Configuring conference with subject [$confSubject] from call [${call.callLog.callId}]"
|
|
||||||
)
|
|
||||||
sipUri.postValue(conference.conferenceAddress?.asStringUriOnly())
|
sipUri.postValue(conference.conferenceAddress?.asStringUriOnly())
|
||||||
subject.postValue(confSubject)
|
subject.postValue(confSubject)
|
||||||
|
|
||||||
|
|
@ -345,15 +353,16 @@ class ConferenceViewModel
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val currentLayout = getCurrentLayout(call)
|
val call = conf.call
|
||||||
|
val currentLayout = if (call == null) AUDIO_ONLY_LAYOUT else getCurrentLayout(call)
|
||||||
conferenceLayout.postValue(currentLayout)
|
conferenceLayout.postValue(currentLayout)
|
||||||
if (currentLayout == GRID_LAYOUT && screenSharing) {
|
if (currentLayout == GRID_LAYOUT && screenSharing) {
|
||||||
Log.w(
|
Log.w(
|
||||||
"$TAG Conference has a participant sharing its screen, changing layout from mosaic to active speaker"
|
"$TAG Conference has a participant sharing its screen, changing layout from mosaic to active speaker"
|
||||||
)
|
)
|
||||||
setNewLayout(ACTIVE_SPEAKER_LAYOUT)
|
setNewLayout(ACTIVE_SPEAKER_LAYOUT)
|
||||||
} else if (currentLayout == AUDIO_ONLY_LAYOUT) {
|
} else if (call != null && currentLayout == AUDIO_ONLY_LAYOUT) {
|
||||||
val defaultLayout = call.core.defaultConferenceLayout.toInt()
|
val defaultLayout = core.defaultConferenceLayout.toInt()
|
||||||
if (defaultLayout == Conference.Layout.ActiveSpeaker.toInt()) {
|
if (defaultLayout == Conference.Layout.ActiveSpeaker.toInt()) {
|
||||||
Log.w("$TAG Joined conference in audio only layout, switching to active speaker layout")
|
Log.w("$TAG Joined conference in audio only layout, switching to active speaker layout")
|
||||||
setNewLayout(ACTIVE_SPEAKER_LAYOUT)
|
setNewLayout(ACTIVE_SPEAKER_LAYOUT)
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@ class CallsListFragment : GenericCallFragment() {
|
||||||
|
|
||||||
model.confirmEvent.observe(viewLifecycleOwner) {
|
model.confirmEvent.observe(viewLifecycleOwner) {
|
||||||
it.consume {
|
it.consume {
|
||||||
viewModel.mergeCallsIntoConference()
|
viewModel.mergeCallsIntoConference(callViewModel.conferenceModel)
|
||||||
dialog.dismiss()
|
dialog.dismiss()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ import org.linphone.core.Core
|
||||||
import org.linphone.core.CoreListenerStub
|
import org.linphone.core.CoreListenerStub
|
||||||
import org.linphone.core.tools.Log
|
import org.linphone.core.tools.Log
|
||||||
import org.linphone.ui.GenericViewModel
|
import org.linphone.ui.GenericViewModel
|
||||||
|
import org.linphone.ui.call.conference.viewmodel.ConferenceViewModel
|
||||||
import org.linphone.ui.call.model.CallModel
|
import org.linphone.ui.call.model.CallModel
|
||||||
import org.linphone.utils.AppUtils
|
import org.linphone.utils.AppUtils
|
||||||
import org.linphone.utils.Event
|
import org.linphone.utils.Event
|
||||||
|
|
@ -216,7 +217,7 @@ class CallsViewModel
|
||||||
}
|
}
|
||||||
|
|
||||||
@UiThread
|
@UiThread
|
||||||
fun mergeCallsIntoConference() {
|
fun mergeCallsIntoConference(conferenceModel: ConferenceViewModel) {
|
||||||
coreContext.postOnCoreThread { core ->
|
coreContext.postOnCoreThread { core ->
|
||||||
val callsCount = core.callsNb
|
val callsCount = core.callsNb
|
||||||
val defaultAccount = LinphoneUtils.getDefaultAccount()
|
val defaultAccount = LinphoneUtils.getDefaultAccount()
|
||||||
|
|
@ -234,6 +235,9 @@ class CallsViewModel
|
||||||
showRedToast(R.string.conference_failed_to_merge_calls_into_conference_toast, R.drawable.warning_circle)
|
showRedToast(R.string.conference_failed_to_merge_calls_into_conference_toast, R.drawable.warning_circle)
|
||||||
} else {
|
} else {
|
||||||
conference.addParticipants(core.calls)
|
conference.addParticipants(core.calls)
|
||||||
|
val firstCall = core.calls.first()
|
||||||
|
conferenceModel.configureFromCall(firstCall)
|
||||||
|
goToActiveCallEvent.postValue(Event(false))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -154,11 +154,11 @@ class HistoryViewModel
|
||||||
val model = CallLogModel(callLog)
|
val model = CallLogModel(callLog)
|
||||||
callLogModel.postValue(model)
|
callLogModel.postValue(model)
|
||||||
|
|
||||||
val conference = callLog.wasConference()
|
val isConference = callLog.wasConference()
|
||||||
isConferenceCallLog.postValue(conference)
|
isConferenceCallLog.postValue(isConference)
|
||||||
meetingChatRoom = callLog.chatRoom
|
meetingChatRoom = callLog.chatRoom
|
||||||
isChatRoomAvailable.postValue(meetingChatRoom != null)
|
isChatRoomAvailable.postValue(meetingChatRoom != null)
|
||||||
if (conference) {
|
if (isConference) {
|
||||||
Log.i(
|
Log.i(
|
||||||
"$TAG Conference call log, chat room is ${ if (meetingChatRoom != null) "available" else "not available"}"
|
"$TAG Conference call log, chat room is ${ if (meetingChatRoom != null) "available" else "not available"}"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue