Misc Service cleanup (#9005)
* Simplify DownloadService wake lock handling _isRunning is only modified in onCreate/onDestroy, so the listener job is redundant. * Drop superclass calls to Service.onCreate/onDestroy From https://developer.android.com/guide/components/services > Note: Unlike the activity lifecycle callback methods, you are not > required to call the superclass implementation of these callback > methods.
This commit is contained in:
@@ -74,8 +74,6 @@ class BackupRestoreService : Service() {
|
||||
private lateinit var notifier: BackupNotifier
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
|
||||
scope = CoroutineScope(SupervisorJob() + Dispatchers.IO)
|
||||
notifier = BackupNotifier(this)
|
||||
wakeLock = acquireWakeLock(javaClass.name)
|
||||
@@ -90,7 +88,6 @@ class BackupRestoreService : Service() {
|
||||
|
||||
override fun onDestroy() {
|
||||
destroyJob()
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
private fun destroyJob() {
|
||||
|
||||
Reference in New Issue
Block a user