Skip to content
Snippets Groups Projects
Commit e657e4fe authored by Alexander Lussier-Cullen's avatar Alexander Lussier-Cullen
Browse files

Call: make plugin toggle call run off the main thread

other calls to the toggle are from services on separate threads

GitLab: #1655
Change-Id: I0c6bd2fc5db431b5f0cd9d484b27b4349d64a12a
parent bc75f0dd
Branches
No related tags found
No related merge requests found
......@@ -1331,10 +1331,6 @@ class CallFragment : BaseSupportFragment<CallPresenter, CallView>(), CallView,
)
}
override fun toggleCallMediaHandler(id: String, callId: String, toggle: Boolean) {
JamiService.toggleCallMediaHandler(id, callId, toggle)
}
fun getCallMediaHandlerDetails(id: String): Map<String, String> {
return JamiService.getCallMediaHandlerDetails(id).toNative()
}
......
......@@ -507,10 +507,6 @@ class TVCallFragment : BaseSupportFragment<CallPresenter, CallView>(), CallView
}
}
override fun toggleCallMediaHandler(id: String, callId: String, toggle: Boolean) {
JamiService.toggleCallMediaHandler(id, callId, toggle)
}
override fun getMediaProjection(resultCode: Int, data: Any): Any {
TODO("Not yet implemented")
}
......
......@@ -20,6 +20,7 @@ import io.reactivex.rxjava3.core.Observable
import io.reactivex.rxjava3.core.Observer
import io.reactivex.rxjava3.core.Scheduler
import io.reactivex.rxjava3.disposables.Disposable
import io.reactivex.rxjava3.schedulers.Schedulers
import net.jami.daemon.JamiService
import net.jami.services.ConversationFacade
import net.jami.model.*
......@@ -535,7 +536,9 @@ class CallPresenter @Inject constructor(
fun toggleCallMediaHandler(id: String, toggle: Boolean) {
val conference = mConference ?: return
if (conference.isOnGoing && conference.hasVideo()) {
view?.toggleCallMediaHandler(id, conference.id, toggle)
mCompositeDisposable.add(Observable.fromCallable {
JamiService.toggleCallMediaHandler(id, conference.id, toggle)
}.subscribeOn(Schedulers.io()).subscribe())
}
}
......
......@@ -49,6 +49,5 @@ interface CallView {
fun displayPluginsButton(): Boolean
fun updateConfInfo(info: List<ParticipantInfo>)
fun updateParticipantRecording(contacts: List<ContactViewModel>)
fun toggleCallMediaHandler(id: String, callId: String, toggle: Boolean)
fun getMediaProjection(resultCode: Int, data: Any): Any
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment