From ebfac823c5a07672938378b46b57edbc55667aeb Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 12 Nov 2024 16:31:59 +0100 Subject: [PATCH] Use clock. --- .../vector/app/features/call/audio/MicrophoneAccessService.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/app/features/call/audio/MicrophoneAccessService.kt b/vector/src/main/java/im/vector/app/features/call/audio/MicrophoneAccessService.kt index 1cf2aee737..bb570442ae 100644 --- a/vector/src/main/java/im/vector/app/features/call/audio/MicrophoneAccessService.kt +++ b/vector/src/main/java/im/vector/app/features/call/audio/MicrophoneAccessService.kt @@ -23,12 +23,14 @@ import dagger.hilt.android.AndroidEntryPoint import im.vector.app.core.extensions.startForegroundCompat import im.vector.app.core.services.VectorAndroidService import im.vector.app.features.notifications.NotificationUtils +import im.vector.lib.core.utils.timer.Clock import javax.inject.Inject @AndroidEntryPoint class MicrophoneAccessService : VectorAndroidService() { @Inject lateinit var notificationUtils: NotificationUtils + @Inject lateinit var clock: Clock private val binder = LocalBinder() override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { @@ -38,7 +40,7 @@ class MicrophoneAccessService : VectorAndroidService() { } private fun showMicrophoneAccessNotification() { - val notificationId = System.currentTimeMillis().toInt() + val notificationId = clock.epochMillis().toInt() val notification = notificationUtils.buildMicrophoneAccessNotification() startForegroundCompat(notificationId, notification) }