fix: Remove premature startForegroundService call from App.onCreate()

Calling startMonitor() in App.onCreate() started the foreground service timeout

clock before the BroadcastReceiver even ran, consuming timeout budget

with post-init work and receiver processing. The service is already

started by BluetoothEventReceiver, BootCompletedReceiver, and

OverviewViewModel, making this call redundant.
This commit is contained in:
darken
2026-03-20 17:49:15 +00:00
committed by Matthias Urhahn
parent 039d20d7aa
commit 992cb5e695
+1 -4
View File
@@ -14,7 +14,7 @@ import eu.darken.capod.common.upgrade.UpgradeRepo
import eu.darken.capod.main.ui.widget.WidgetManager
import eu.darken.capod.monitor.core.PodMonitor
import eu.darken.capod.monitor.core.devicesWithProfiles
import eu.darken.capod.monitor.core.worker.MonitorControl
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.launchIn
@@ -27,7 +27,6 @@ import javax.inject.Inject
open class App : Application() {
@Inject lateinit var autoReporting: AutomaticBugReporter
@Inject lateinit var monitorControl: MonitorControl
@Inject lateinit var podMonitor: PodMonitor
@Inject lateinit var widgetManager: WidgetManager
@Inject lateinit var upgradeRepo: UpgradeRepo
@@ -41,8 +40,6 @@ open class App : Application() {
log(TAG) { "onCreate() done! ${Exception().asLog()}" }
monitorControl.startMonitor(forceStart = true)
appScope.launch { widgetManager.refreshWidgets() }
podMonitor.devicesWithProfiles()