mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-23 09:56:00 +03:00
Merge pull request #6679 from vector-im/fix/mna/audio-controller-leak
[Timeline] Memory leak in audio message playback tracker
This commit is contained in:
commit
619cb29707
4 changed files with 4 additions and 5 deletions
1
changelog.d/6678.misc
Normal file
1
changelog.d/6678.misc
Normal file
|
@ -0,0 +1 @@
|
|||
[Timeline] Memory leak in audio message playback tracker
|
|
@ -965,7 +965,7 @@ class TimelineFragment @Inject constructor(
|
|||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
audioMessagePlaybackTracker.makeAllPlaybacksIdle()
|
||||
messageComposerViewModel.endAllVoiceActions()
|
||||
lazyLoadedViews.unBind()
|
||||
timelineEventController.callback = null
|
||||
timelineEventController.removeModelBuildListener(modelBuildListener)
|
||||
|
@ -1098,7 +1098,7 @@ class TimelineFragment @Inject constructor(
|
|||
else -> state.isAllowedToManageWidgets
|
||||
}
|
||||
menu.findItem(R.id.video_call).icon?.alpha = if (callButtonsEnabled) 0xFF else 0x40
|
||||
menu.findItem(R.id.voice_call).icon?.alpha = if (callButtonsEnabled || state.hasActiveElementCallWidget()) 0xFF else 0x40
|
||||
menu.findItem(R.id.voice_call).icon?.alpha = if (callButtonsEnabled || state.hasActiveElementCallWidget()) 0xFF else 0x40
|
||||
|
||||
val matrixAppsMenuItem = menu.findItem(R.id.open_matrix_apps)
|
||||
val widgetsCount = state.activeRoomWidgets.invoke()?.size ?: 0
|
||||
|
|
|
@ -41,7 +41,6 @@ sealed class MessageComposerAction : VectorViewModelAction {
|
|||
object PauseRecordingVoiceMessage : MessageComposerAction()
|
||||
data class PlayOrPauseVoicePlayback(val eventId: String, val messageAudioContent: MessageAudioContent) : MessageComposerAction()
|
||||
object PlayOrPauseRecordingPlayback : MessageComposerAction()
|
||||
data class EndAllVoiceActions(val deleteRecord: Boolean = true) : MessageComposerAction()
|
||||
data class VoiceWaveformTouchedUp(val eventId: String, val duration: Int, val percentage: Float) : MessageComposerAction()
|
||||
data class VoiceWaveformMovedTo(val eventId: String, val duration: Int, val percentage: Float) : MessageComposerAction()
|
||||
data class AudioSeekBarMovedTo(val eventId: String, val duration: Int, val percentage: Float) : MessageComposerAction()
|
||||
|
|
|
@ -107,7 +107,6 @@ class MessageComposerViewModel @AssistedInject constructor(
|
|||
is MessageComposerAction.PlayOrPauseVoicePlayback -> handlePlayOrPauseVoicePlayback(action)
|
||||
MessageComposerAction.PauseRecordingVoiceMessage -> handlePauseRecordingVoiceMessage()
|
||||
MessageComposerAction.PlayOrPauseRecordingPlayback -> handlePlayOrPauseRecordingPlayback()
|
||||
is MessageComposerAction.EndAllVoiceActions -> handleEndAllVoiceActions(action.deleteRecord)
|
||||
is MessageComposerAction.InitializeVoiceRecorder -> handleInitializeVoiceRecorder(action.attachmentData)
|
||||
is MessageComposerAction.OnEntersBackground -> handleEntersBackground(action.composerText)
|
||||
is MessageComposerAction.VoiceWaveformTouchedUp -> handleVoiceWaveformTouchedUp(action)
|
||||
|
@ -887,7 +886,7 @@ class MessageComposerViewModel @AssistedInject constructor(
|
|||
audioMessageHelper.startOrPauseRecordingPlayback()
|
||||
}
|
||||
|
||||
private fun handleEndAllVoiceActions(deleteRecord: Boolean) {
|
||||
fun endAllVoiceActions(deleteRecord: Boolean = true) {
|
||||
audioMessageHelper.clearTracker()
|
||||
audioMessageHelper.stopAllVoiceActions(deleteRecord)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue