Skip to content

Commit ebfac82

Browse files
committed
Use clock.
1 parent fbef34f commit ebfac82

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

vector/src/main/java/im/vector/app/features/call/audio/MicrophoneAccessService.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@ import dagger.hilt.android.AndroidEntryPoint
2323
import im.vector.app.core.extensions.startForegroundCompat
2424
import im.vector.app.core.services.VectorAndroidService
2525
import im.vector.app.features.notifications.NotificationUtils
26+
import im.vector.lib.core.utils.timer.Clock
2627
import javax.inject.Inject
2728

2829
@AndroidEntryPoint
2930
class MicrophoneAccessService : VectorAndroidService() {
3031

3132
@Inject lateinit var notificationUtils: NotificationUtils
33+
@Inject lateinit var clock: Clock
3234
private val binder = LocalBinder()
3335

3436
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
@@ -38,7 +40,7 @@ class MicrophoneAccessService : VectorAndroidService() {
3840
}
3941

4042
private fun showMicrophoneAccessNotification() {
41-
val notificationId = System.currentTimeMillis().toInt()
43+
val notificationId = clock.epochMillis().toInt()
4244
val notification = notificationUtils.buildMicrophoneAccessNotification()
4345
startForegroundCompat(notificationId, notification)
4446
}

0 commit comments

Comments
 (0)