fix: make root service starts idempotent (#6055)

This commit is contained in:
eliotcougar authored and GitHub committed 2026-08-14 14:09:31 +08:00
1 parent e8a82d9810
commit 606246f36e
1 file changed
+5
@@ -43,6 +43,11 @@ class CoreRootService : Service(), ServiceControl {
NotificationManager.ensureForeground()
LogUtil.i(AppConfig.TAG, "StartCore-Root: command received")
if (CoreServiceManager.isRunning()) {
LogUtil.i(AppConfig.TAG, "StartCore-Root: Core is already running")
return START_STICKY
}
// Start the in-process core first (this also posts the foreground notification),
// then install the root routing off the main thread.
if (!CoreServiceManager.startCoreLoop(null)) {