This commit is contained in:
Felitendo
2025-05-20 15:17:20 +02:00
parent 034f1210fb
commit c24d95627e
399 changed files with 35059 additions and 2 deletions

View File

@@ -0,0 +1,22 @@
package com.looker.droidify.service
import android.app.Service
import android.content.Intent
import android.os.IBinder
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.cancel
abstract class ConnectionService<T : IBinder> : Service() {
private val supervisorJob = SupervisorJob()
val lifecycleScope = CoroutineScope(Dispatchers.Main + supervisorJob)
abstract override fun onBind(intent: Intent): T
override fun onDestroy() {
super.onDestroy()
lifecycleScope.cancel()
}
}