diff --git a/app/src/main/java/io/legado/app/service/CheckSourceService.kt b/app/src/main/java/io/legado/app/service/CheckSourceService.kt index 5fa36c1ba..ba36d1e8b 100644 --- a/app/src/main/java/io/legado/app/service/CheckSourceService.kt +++ b/app/src/main/java/io/legado/app/service/CheckSourceService.kt @@ -7,23 +7,34 @@ import io.legado.app.base.BaseService import io.legado.app.constant.Action import io.legado.app.constant.AppConst import io.legado.app.data.entities.BookSource +import io.legado.app.help.AppConfig import io.legado.app.help.IntentHelp import io.legado.app.ui.book.source.manage.BookSourceActivity +import kotlinx.coroutines.asCoroutineDispatcher +import java.util.concurrent.Executors class CheckSourceService : BaseService() { - + private var searchPool = + Executors.newFixedThreadPool(AppConfig.threadCount).asCoroutineDispatcher() private var sourceList: List? = null override fun onCreate() { super.onCreate() + updateNotification(0, getString(R.string.start)) } override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { + when (intent?.action) { + Action.start -> { + } + else -> stopSelf() + } return super.onStartCommand(intent, flags, startId) } override fun onDestroy() { super.onDestroy() + searchPool.close() } /**