diff options
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/services')
4 files changed, 19 insertions, 10 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/services/BaseJobService.kt b/app/src/main/kotlin/com/pitchedapps/frost/services/BaseJobService.kt index 4d1317d5..0db08d0f 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/services/BaseJobService.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/services/BaseJobService.kt @@ -20,9 +20,9 @@ import android.app.job.JobParameters import android.app.job.JobService import androidx.annotation.CallSuper import ca.allanwang.kau.utils.ContextHelper -import kotlin.coroutines.CoroutineContext import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Job +import kotlin.coroutines.CoroutineContext abstract class BaseJobService : JobService(), CoroutineScope { diff --git a/app/src/main/kotlin/com/pitchedapps/frost/services/LocalService.kt b/app/src/main/kotlin/com/pitchedapps/frost/services/LocalService.kt index 8219049a..3d66f1ee 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/services/LocalService.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/services/LocalService.kt @@ -24,10 +24,10 @@ import android.content.Context import android.os.PersistableBundle import com.pitchedapps.frost.activities.ImageActivity import com.pitchedapps.frost.utils.L -import java.io.FileFilter import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import kotlinx.coroutines.withContext +import java.io.FileFilter class LocalService : BaseJobService() { diff --git a/app/src/main/kotlin/com/pitchedapps/frost/services/NotificationService.kt b/app/src/main/kotlin/com/pitchedapps/frost/services/NotificationService.kt index 55dad065..01f52caa 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/services/NotificationService.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/services/NotificationService.kt @@ -29,12 +29,13 @@ import com.pitchedapps.frost.prefs.Prefs import com.pitchedapps.frost.utils.L import com.pitchedapps.frost.utils.frostEvent import com.pitchedapps.frost.widgets.NotificationWidget +import dagger.hilt.android.AndroidEntryPoint import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.isActive import kotlinx.coroutines.launch import kotlinx.coroutines.withContext import kotlinx.coroutines.yield -import org.koin.android.ext.android.inject +import javax.inject.Inject /** * Created by Allan Wang on 2017-06-14. @@ -44,11 +45,17 @@ import org.koin.android.ext.android.inject * * All fetching is done through parsers */ +@AndroidEntryPoint class NotificationService : BaseJobService() { - private val prefs: Prefs by inject() - private val notifDao: NotificationDao by inject() - private val cookieDao: CookieDao by inject() + @Inject + lateinit var prefs: Prefs + + @Inject + lateinit var notifDao: NotificationDao + + @Inject + lateinit var cookieDao: CookieDao override fun onStopJob(params: JobParameters?): Boolean { super.onStopJob(params) diff --git a/app/src/main/kotlin/com/pitchedapps/frost/services/UpdateReceiver.kt b/app/src/main/kotlin/com/pitchedapps/frost/services/UpdateReceiver.kt index 439838a9..91a60d90 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/services/UpdateReceiver.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/services/UpdateReceiver.kt @@ -21,17 +21,19 @@ import android.content.Context import android.content.Intent import com.pitchedapps.frost.prefs.Prefs import com.pitchedapps.frost.utils.L -import org.koin.core.component.KoinComponent -import org.koin.core.component.inject +import dagger.hilt.android.AndroidEntryPoint +import javax.inject.Inject /** * Created by Allan Wang on 2017-05-31. * * Receiver that is triggered whenever the app updates so it can bind the notifications again */ -class UpdateReceiver : BroadcastReceiver(), KoinComponent { +@AndroidEntryPoint +class UpdateReceiver : BroadcastReceiver() { - private val prefs: Prefs by inject() + @Inject + lateinit var prefs: Prefs override fun onReceive(context: Context, intent: Intent) { if (intent.action != Intent.ACTION_MY_PACKAGE_REPLACED) return |