mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-27 15:26:58 +00:00
fix: Re-added functions in ExecutorsModule.kt
This commit is contained in:
@@ -66,6 +66,76 @@ import kotlinx.coroutines.asCoroutineDispatcher
|
||||
@Module
|
||||
interface ExecutorsModule {
|
||||
|
||||
// Unordered background executors
|
||||
@Binds
|
||||
@ThreadPool
|
||||
fun provideThreadPoolExecutor(
|
||||
@ThreadPool listeningExecutorService: ListeningExecutorService
|
||||
): Executor
|
||||
|
||||
@Binds
|
||||
@ThreadPool
|
||||
fun provideThreadPoolExecutorService(
|
||||
@ThreadPool listeningExecutorService: ListeningExecutorService
|
||||
): ExecutorService
|
||||
// end unordered background executors
|
||||
|
||||
// Ordered background executors
|
||||
@Binds
|
||||
@Background
|
||||
fun provideBackgroundExecutor(
|
||||
@Background listeningExecutorService: ListeningExecutorService
|
||||
): Executor
|
||||
|
||||
@Binds
|
||||
@Background
|
||||
fun provideBackgroundExecutorService(
|
||||
@Background listeningExecutorService: ListeningExecutorService
|
||||
): ExecutorService
|
||||
|
||||
@Binds
|
||||
@LightweightBackground(LightweightBackgroundPriority.UI)
|
||||
fun provideUiLightweightBackgroundExecutor(
|
||||
@LightweightBackground(LightweightBackgroundPriority.UI)
|
||||
listeningExecutorService: ListeningExecutorService
|
||||
): Executor
|
||||
|
||||
@Binds
|
||||
@LightweightBackground(LightweightBackgroundPriority.UI)
|
||||
fun provideUiLightweightBackgroundExecutorService(
|
||||
@LightweightBackground(LightweightBackgroundPriority.UI)
|
||||
listeningExecutorService: ListeningExecutorService
|
||||
): ExecutorService
|
||||
|
||||
@Binds
|
||||
@LightweightBackground(LightweightBackgroundPriority.DATA)
|
||||
fun provideDataLightweightBackgroundExecutor(
|
||||
@LightweightBackground(LightweightBackgroundPriority.DATA)
|
||||
listeningExecutorService: ListeningExecutorService
|
||||
): Executor
|
||||
|
||||
@Binds
|
||||
@LightweightBackground(LightweightBackgroundPriority.DATA)
|
||||
fun provideDataLightweightBackgroundExecutorService(
|
||||
@LightweightBackground(LightweightBackgroundPriority.DATA)
|
||||
listeningExecutorService: ListeningExecutorService
|
||||
): ExecutorService
|
||||
// end ordered background executors
|
||||
|
||||
// UI executors
|
||||
@Binds
|
||||
@Ui
|
||||
fun provideUiExecutor(
|
||||
@Ui listeningExecutorService: ListeningExecutorService
|
||||
): Executor
|
||||
|
||||
@Binds
|
||||
@Ui
|
||||
fun provideUiExecutorService(
|
||||
@Ui listeningExecutorService: ListeningExecutorService
|
||||
): ExecutorService
|
||||
// end UI executors
|
||||
|
||||
// The following methods provide the CoroutineContext for the executors.
|
||||
companion object {
|
||||
|
||||
|
||||
@@ -34,9 +34,6 @@ import dagger.Module
|
||||
import dagger.Binds
|
||||
import dagger.Provides
|
||||
|
||||
import java.util.concurrent.Executor
|
||||
import java.util.concurrent.ExecutorService
|
||||
|
||||
/**
|
||||
* Module that provides the executors for Launcher3 as per the [ExecutorsModule]
|
||||
* interface.
|
||||
@@ -89,4 +86,4 @@ abstract class LauncherExecutorsModule {
|
||||
return MoreExecutors.listeningDecorator(Executors.THREAD_POOL_EXECUTOR)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user