diff --git a/common/car/src/main/java/com/kouros/navigation/car/NotificationManager.kt b/common/car/src/main/java/com/kouros/navigation/car/NavigationNotificationManager.kt similarity index 64% rename from common/car/src/main/java/com/kouros/navigation/car/NotificationManager.kt rename to common/car/src/main/java/com/kouros/navigation/car/NavigationNotificationManager.kt index 59c53e7..c032464 100644 --- a/common/car/src/main/java/com/kouros/navigation/car/NotificationManager.kt +++ b/common/car/src/main/java/com/kouros/navigation/car/NavigationNotificationManager.kt @@ -1,22 +1,15 @@ package com.kouros.navigation.car import android.content.Intent -import android.location.Location -import android.os.Message -import android.util.Log import androidx.car.app.CarContext -import androidx.car.app.hardware.CarHardwareManager import androidx.lifecycle.Lifecycle import androidx.lifecycle.LifecycleOwner import androidx.lifecycle.lifecycleScope import androidx.lifecycle.repeatOnLifecycle -import com.kouros.navigation.data.Constants.TAG -import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.launch -class NotificationManager( +class NavigationNotificationManager( private val carContext: CarContext, - private val lifecycleOwner: LifecycleOwner, ) { private var notificationServiceStarted = false @@ -24,16 +17,7 @@ class NotificationManager( private var serviceStarted = false init { - lifecycleOwner.lifecycleScope.launch { - lifecycleOwner.repeatOnLifecycle(Lifecycle.State.STARTED) { - } - lifecycleOwner.repeatOnLifecycle(Lifecycle.State.DESTROYED) { - if (notificationServiceStarted) { - stopNotificationService() - } - } - } } fun startNotificationService() { diff --git a/common/car/src/main/java/com/kouros/navigation/car/NavigationNotificationService.kt b/common/car/src/main/java/com/kouros/navigation/car/NavigationNotificationService.kt index 190e1a4..6b3b244 100644 --- a/common/car/src/main/java/com/kouros/navigation/car/NavigationNotificationService.kt +++ b/common/car/src/main/java/com/kouros/navigation/car/NavigationNotificationService.kt @@ -111,7 +111,7 @@ class NavigationNotificationService : Service() { * Initializes the notifications, if needed. * * - * [NotificationManager.IMPORTANCE_HIGH] is needed to show the alerts on top of the car + * [NavigationNotificationManager.IMPORTANCE_HIGH] is needed to show the alerts on top of the car * screen. However, the rail widget at the bottom of the screen will show regardless of the * importance setting. */