diff --git a/app/src/debug/kotlin/org/koitharu/kotatsu/core/ui/BaseService.kt b/app/src/debug/kotlin/org/koitharu/kotatsu/core/ui/BaseService.kt new file mode 100644 index 000000000..6453ac7fe --- /dev/null +++ b/app/src/debug/kotlin/org/koitharu/kotatsu/core/ui/BaseService.kt @@ -0,0 +1,15 @@ +package org.koitharu.kotatsu.core.ui + +import androidx.lifecycle.LifecycleService +import leakcanary.AppWatcher + +abstract class BaseService : LifecycleService() { + + override fun onDestroy() { + super.onDestroy() + AppWatcher.objectWatcher.watch( + watchedObject = this, + description = "${javaClass.simpleName} service received Service#onDestroy() callback", + ) + } +} diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/core/ui/BaseService.kt b/app/src/nightly/kotlin/org/koitharu/kotatsu/core/ui/BaseService.kt similarity index 100% rename from app/src/main/kotlin/org/koitharu/kotatsu/core/ui/BaseService.kt rename to app/src/nightly/kotlin/org/koitharu/kotatsu/core/ui/BaseService.kt diff --git a/app/src/release/kotlin/org/koitharu/kotatsu/core/ui/BaseService.kt b/app/src/release/kotlin/org/koitharu/kotatsu/core/ui/BaseService.kt new file mode 100644 index 000000000..7a8f1463c --- /dev/null +++ b/app/src/release/kotlin/org/koitharu/kotatsu/core/ui/BaseService.kt @@ -0,0 +1,5 @@ +package org.koitharu.kotatsu.core.ui + +import androidx.lifecycle.LifecycleService + +abstract class BaseService : LifecycleService()