Skip to content
Snippets Groups Projects
Commit 147ee018 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

call presenter: replay last call in initIncomingCall

Change-Id: Ie24f1a58ba7d3c3cd2c8cd3f5292372db3aeef78
parent b0b92a60
No related branches found
No related tags found
No related merge requests found
......@@ -134,7 +134,7 @@ class CallPresenter @Inject constructor(
incomingIsFullIntent = actionViewOnly
val callObservable = mCallService.getConfUpdates(confId)
.observeOn(mUiScheduler)
.share()
.replay(1).refCount()
// Handles the case where the call has been accepted, emits a single so as to only check for permissions and start the call once
if (!actionViewOnly) {
......@@ -181,9 +181,9 @@ class CallPresenter @Inject constructor(
*/
private fun showConference(conference: Observable<Conference>){
val conference = conference.distinctUntilChanged()
mCompositeDisposable.add(conference
.switchMap { obj: Conference -> Observable.combineLatest(obj.participantInfo, mPendingSubject,
.switchMap { obj: Conference ->
Observable.combineLatest(obj.participantInfo, mPendingSubject,
if (obj.isConference)
ContactViewModel.EMPTY_VM
else
......
......@@ -158,9 +158,7 @@ class CallService(
private class ConferenceEntity internal constructor(var conference: Conference)
fun getConfUpdates(call: Call): Observable<Conference> {
return getConfUpdates(getConference(call))
}
fun getConfUpdates(call: Call): Observable<Conference> = getConfUpdates(getConference(call))
private fun getConfUpdates(conference: Conference): Observable<Conference> {
Log.w(TAG, "getConfUpdates " + conference.id)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment