mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Fixed call duration timer when leaving & resuming active call fragment
This commit is contained in:
parent
46e06f2c9d
commit
913e7cdb02
4 changed files with 14 additions and 4 deletions
|
|
@ -325,7 +325,7 @@ class CoreContext @UiThread constructor(val context: Context) : HandlerThread("C
|
|||
|
||||
@WorkerThread
|
||||
fun terminateCall(call: Call) {
|
||||
Log.i("$TAG Terminating call $call")
|
||||
Log.i("$TAG Terminating call [${call.remoteAddress.asStringUriOnly()}]")
|
||||
call.terminate()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ class TelecomCallControlCallback constructor(
|
|||
override suspend fun onDisconnect(disconnectCause: DisconnectCause): Boolean {
|
||||
Log.i("$TAG We're asked to terminate the call with reason [$disconnectCause]")
|
||||
coreContext.postOnCoreThread {
|
||||
Log.i("$TAG Terminating call")
|
||||
Log.i("$TAG Terminating call [${call.remoteAddress.asStringUriOnly()}]")
|
||||
call.terminate() // TODO: use cause
|
||||
}
|
||||
return true
|
||||
|
|
|
|||
|
|
@ -219,6 +219,9 @@ class ActiveCallFragment : GenericCallFragment() {
|
|||
core.nativeVideoWindowId = binding.remoteVideoSurface
|
||||
coreContext.core.nativePreviewWindowId = binding.localPreviewVideoSurface
|
||||
binding.localPreviewVideoSurface.setOnTouchListener(previewTouchListener)
|
||||
|
||||
// Need to be done manually
|
||||
callViewModel.updateCallDuration()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ class CurrentCallViewModel @UiThread constructor() : ViewModel() {
|
|||
|
||||
if (currentCall != null) {
|
||||
call = currentCall
|
||||
Log.i("$TAG Found call [$call]")
|
||||
Log.i("$TAG Found call [${call.remoteAddress.asStringUriOnly()}]")
|
||||
configureCall(call)
|
||||
} else {
|
||||
Log.e("$TAG Failed to find call!")
|
||||
|
|
@ -185,7 +185,7 @@ class CurrentCallViewModel @UiThread constructor() : ViewModel() {
|
|||
fun hangUp() {
|
||||
coreContext.postOnCoreThread {
|
||||
if (::call.isInitialized) {
|
||||
Log.i("$TAG Terminating call [$call]")
|
||||
Log.i("$TAG Terminating call [${call.remoteAddress.asStringUriOnly()}]")
|
||||
call.terminate()
|
||||
}
|
||||
}
|
||||
|
|
@ -421,6 +421,13 @@ class CurrentCallViewModel @UiThread constructor() : ViewModel() {
|
|||
callDuration.postValue(call.duration)
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
fun updateCallDuration() {
|
||||
if (::call.isInitialized) {
|
||||
callDuration.postValue(call.duration)
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateOutputAudioDevice(audioDevice: AudioDevice?) {
|
||||
isSpeakerEnabled.postValue(audioDevice?.type == AudioDevice.Type.Speaker)
|
||||
isHeadsetEnabled.postValue(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue