Properly setup Service::onTimeout
This commit is contained in:
parent
b5e7ed3801
commit
15d6e46ec2
@ -188,6 +188,12 @@ class DownloadService : ConnectionService<DownloadService.Binder>() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onTimeout(startId: Int) {
|
||||
super.onTimeout(startId)
|
||||
onDestroy()
|
||||
stopSelf()
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
cancelTasks(null)
|
||||
|
@ -216,6 +216,12 @@ class SyncService : ConnectionService<SyncService.Binder>() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onTimeout(startId: Int) {
|
||||
super.onTimeout(startId)
|
||||
onDestroy()
|
||||
stopSelf()
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
downloadConnection.unbind(this)
|
||||
|
@ -16,8 +16,6 @@ import com.looker.sync.fdroid.v2.model.Entry
|
||||
import com.looker.sync.fdroid.v2.model.IndexV2
|
||||
import com.looker.sync.fdroid.v2.model.IndexV2Diff
|
||||
import kotlinx.coroutines.CoroutineDispatcher
|
||||
import kotlinx.coroutines.async
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import kotlinx.serialization.ExperimentalSerializationApi
|
||||
import kotlinx.serialization.json.Json
|
||||
|
Loading…
x
Reference in New Issue
Block a user