Skip to content
Snippets Groups Projects
Commit 3cd00ed3 authored by Alexander Lussier-Cullen's avatar Alexander Lussier-Cullen Committed by Adrien Béraud
Browse files

DRingService: fix hangup in conference

Change-Id: I66d31a886f735011ab8877de17d51a63aa551072
parent 8d703580
No related branches found
No related tags found
No related merge requests found
......@@ -401,7 +401,7 @@ class CallFragment : BaseSupportFragment<CallPresenter, CallView>(), CallView,
//todo: enable pip when only our video is displayed
override fun enterPipMode(callId: String, accountId: String) {
override fun enterPipMode(accountId: String, callId: String?) {
val context = requireContext()
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N || !context.packageManager.hasSystemFeature(PackageManager.FEATURE_PICTURE_IN_PICTURE))
return
......
......@@ -291,7 +291,7 @@ class DRingService : Service() {
mHardwareService.closeAudioState()
}
ACTION_CALL_END -> {
mCallService.hangUp(accountId, callId)
mCallService.hangUpAny(accountId, callId)
mHardwareService.closeAudioState()
}
}
......
......@@ -564,7 +564,7 @@ class TVCallFragment : BaseSupportFragment<CallPresenter, CallView>(), CallView
presenter.requestPipMode()
}
override fun enterPipMode(callId: String, accountId: String) {
override fun enterPipMode(accountId: String, callId: String?) {
val context = requireContext()
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N || !context.packageManager.hasSystemFeature(PackageManager.FEATURE_PICTURE_IN_PICTURE))
return
......
......@@ -521,7 +521,7 @@ class CallPresenter @Inject constructor(
fun requestPipMode() {
val conference = mConference ?: return
if (conference.isOnGoing && conference.hasVideo()) {
view?.enterPipMode(conference.id, conference.accountId)
view?.enterPipMode(conference.accountId, conference.firstCall?.daemonIdString)
}
}
......
......@@ -45,7 +45,7 @@ interface CallView {
fun startAddParticipant(conferenceId: String)
fun finish()
fun onUserLeave()
fun enterPipMode(callId: String, accountId: String)
fun enterPipMode(accountId: String, callId: String?)
fun prepareCall(acceptIncomingCall: Boolean)
fun handleCallWakelock(isAudioOnly: Boolean)
fun goToContact(accountId: String, contact: Contact)
......
......@@ -602,6 +602,7 @@ class CallService(
}
fun hangUpConference(accountId: String, confId: String) {
Log.i(TAG, "hangUpConference() running... $confId")
mExecutor.execute { JamiService.hangUpConference(accountId, confId) }
}
......@@ -688,6 +689,16 @@ class CallService(
}
}
fun hangUpAny(accountId: String, callId: String) {
calls.filterValues { it.daemonIdString == callId }.firstNotNullOf {
val confId = it.value.confId
if(confId != null)
hangUpConference(accountId, confId)
else
hangUp(accountId, callId)
}
}
companion object {
private val TAG = CallService::class.simpleName!!
const val MIME_TEXT_PLAIN = "text/plain"
......
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