Coverage Summary for Class: PlayerServiceModule (com.vsevolodganin.clicktrack.di.module)
| Class |
Method, %
|
Branch, %
|
Line, %
|
Instruction, %
|
| PlayerServiceModule |
0%
(0/2)
|
|
0%
(0/2)
|
0%
(0/7)
|
| PlayerServiceModule$ProvidePlayerCoroutineDispatcherMetroFactory |
0%
(0/1)
|
|
0%
(0/1)
|
0%
(0/8)
|
| PlayerServiceModule$ProvidePlayerServiceCoroutineScopeMetroFactory |
0%
(0/1)
|
|
0%
(0/1)
|
0%
(0/8)
|
| Total |
0%
(0/4)
|
|
0%
(0/4)
|
0%
(0/23)
|
package com.vsevolodganin.clicktrack.di.module
import android.os.Process
import com.vsevolodganin.clicktrack.di.component.PlayerServiceScope
import com.vsevolodganin.clicktrack.player.PlayerDispatcher
import com.vsevolodganin.clicktrack.utils.coroutine.createSingleThreadCoroutineDispatcher
import dev.zacsweers.metro.BindingContainer
import dev.zacsweers.metro.ContributesTo
import dev.zacsweers.metro.Provides
import dev.zacsweers.metro.SingleIn
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
@ContributesTo(PlayerServiceScope::class)
@BindingContainer
object PlayerServiceModule {
@Provides
@SingleIn(PlayerServiceScope::class)
fun providePlayerServiceCoroutineScope(): CoroutineScope {
return CoroutineScope(Dispatchers.Main.immediate)
}
@Provides
@SingleIn(PlayerServiceScope::class)
fun providePlayerCoroutineDispatcher(): PlayerDispatcher {
return createSingleThreadCoroutineDispatcher("ClickTrackPlayer", Process.THREAD_PRIORITY_URGENT_AUDIO)
}
}