From 3ce757ee4bd52b6ab945c1bc532a34a67cca7b63 Mon Sep 17 00:00:00 2001 From: Florian Renaud Date: Mon, 30 Jan 2023 14:26:34 +0100 Subject: [PATCH] Remove useless code since CountUpTimer notify on pause and stop --- .../recording/VoiceBroadcastRecorderQ.kt | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/voicebroadcast/recording/VoiceBroadcastRecorderQ.kt b/vector/src/main/java/im/vector/app/features/voicebroadcast/recording/VoiceBroadcastRecorderQ.kt index 7ca6ab3c9c..5af3b2f05b 100644 --- a/vector/src/main/java/im/vector/app/features/voicebroadcast/recording/VoiceBroadcastRecorderQ.kt +++ b/vector/src/main/java/im/vector/app/features/voicebroadcast/recording/VoiceBroadcastRecorderQ.kt @@ -248,30 +248,20 @@ class VoiceBroadcastRecorderQ( recordingTicker = CountUpTimer().apply { tickListener = CountUpTimer.TickListener { onTick(elapsedTime()) } resume() - onTick(elapsedTime()) } } fun pause() { - recordingTicker?.apply { - pause() - onTick(elapsedTime()) - } + recordingTicker?.pause() } fun resume() { - recordingTicker?.apply { - resume() - onTick(elapsedTime()) - } + recordingTicker?.resume() } fun stop() { - recordingTicker?.apply { - stop() - onTick(elapsedTime()) - recordingTicker = null - } + recordingTicker?.stop() + recordingTicker = null } private fun onTick(elapsedTimeMillis: Long) {