From 036a81d60ba7aedeea34993273bf4e1b8fe58743 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Thu, 4 Nov 2021 09:47:16 +0000 Subject: [PATCH] extending from the vector service to avoid extra service boilerplate --- .../im/vector/app/fdroid/service/GuardService.kt | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/vector/src/fdroid/java/im/vector/app/fdroid/service/GuardService.kt b/vector/src/fdroid/java/im/vector/app/fdroid/service/GuardService.kt index 324af8272a..053cf87c17 100644 --- a/vector/src/fdroid/java/im/vector/app/fdroid/service/GuardService.kt +++ b/vector/src/fdroid/java/im/vector/app/fdroid/service/GuardService.kt @@ -15,13 +15,11 @@ */ package im.vector.app.fdroid.service -import android.app.Service import android.content.Intent -import android.os.IBinder import dagger.hilt.android.AndroidEntryPoint import im.vector.app.R +import im.vector.app.core.services.VectorService import im.vector.app.features.notifications.NotificationUtils -import timber.log.Timber import javax.inject.Inject /** @@ -31,17 +29,10 @@ import javax.inject.Inject * when the app is not in the foreground. */ @AndroidEntryPoint -class GuardService : Service() { +class GuardService : VectorService() { @Inject lateinit var notificationUtils: NotificationUtils - override fun onBind(intent: Intent?): IBinder? = null - - override fun onCreate() { - super.onCreate() - Timber.i("## Sync: onCreate GuardService") - } - override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { val notificationSubtitleRes = R.string.notification_listening_for_notifications val notification = notificationUtils.buildForegroundServiceNotification(notificationSubtitleRes, false)