From a6df28d421ca50e87cf6366bf195551412572b43 Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 5 Feb 2020 15:31:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/service/CheckSourceService.kt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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() } /**