mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-16 02:05:06 +08:00
extending from the vector service to avoid extra service boilerplate
This commit is contained in:
parent
48678382ba
commit
036a81d60b
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user