mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Trying to prevent call activity from being stuck
This commit is contained in:
parent
09263382e1
commit
9a5e9631ea
3 changed files with 14 additions and 7 deletions
|
|
@ -102,6 +102,7 @@ class ControlsFragment : GenericFragment<CallControlsFragmentBinding>() {
|
|||
viewLifecycleOwner
|
||||
) {
|
||||
it.consume {
|
||||
Log.i("[Controls Fragment] No more call, finishing activity")
|
||||
requireActivity().finish()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,6 +49,11 @@ class CallsViewModel : ViewModel() {
|
|||
}
|
||||
|
||||
private val listener = object : CoreListenerStub() {
|
||||
override fun onLastCallEnded(core: Core) {
|
||||
Log.i("[Calls VM] Last call ended")
|
||||
noMoreCallEvent.value = Event(true)
|
||||
}
|
||||
|
||||
override fun onCallStateChanged(core: Core, call: Call, state: Call.State, message: String) {
|
||||
Log.i("[Calls VM] Call state changed: $state")
|
||||
callPausedByRemote.value = (state == Call.State.PausedByRemote) and (call.conference == null)
|
||||
|
|
@ -63,9 +68,9 @@ class CallsViewModel : ViewModel() {
|
|||
}
|
||||
|
||||
if (state == Call.State.End || state == Call.State.Released || state == Call.State.Error) {
|
||||
if (core.callsNb == 0) {
|
||||
noMoreCallEvent.value = Event(true)
|
||||
} else {
|
||||
val callsNb = core.callsNb
|
||||
Log.i("[Calls VM] Calls NB = $callsNb")
|
||||
if (callsNb > 0) {
|
||||
removeCallFromPausedListIfPresent(call)
|
||||
}
|
||||
} else if (state == Call.State.Paused) {
|
||||
|
|
|
|||
|
|
@ -128,6 +128,11 @@ class CoreContext(val context: Context, coreConfig: Config) {
|
|||
}
|
||||
}
|
||||
|
||||
override fun onLastCallEnded(core: Core) {
|
||||
Log.i("[Context] Last call ended")
|
||||
removeCallOverlay()
|
||||
}
|
||||
|
||||
override fun onCallStateChanged(
|
||||
core: Core,
|
||||
call: Call,
|
||||
|
|
@ -200,10 +205,6 @@ class CoreContext(val context: Context, coreConfig: Config) {
|
|||
}
|
||||
}
|
||||
} else if (state == Call.State.End || state == Call.State.Error || state == Call.State.Released) {
|
||||
if (core.callsNb == 0) {
|
||||
removeCallOverlay()
|
||||
}
|
||||
|
||||
if (state == Call.State.Error) {
|
||||
Log.w("[Context] Call error reason is ${call.errorInfo.protocolCode} / ${call.errorInfo.reason} / ${call.errorInfo.phrase}")
|
||||
val message = when (call.errorInfo.reason) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue