perf(startup): move WorkManager and AppFunctions init off the main thread (#6648)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
James RichandClaude Fable 5 authored and GitHub committed 2026-08-12 18:04:26 +00:00
1 parent b5152d14a0
commit 8321df705a
2 files changed
+7 -4

No files matched your search

@@ -17,6 +17,7 @@
package org.meshtastic.app
import androidx.appfunctions.AppFunctionConfiguration
import kotlinx.coroutines.launch
import org.koin.java.KoinJavaComponent.getKoin
import org.meshtastic.app.ai.appfunctions.AppFunctionStateSync
import org.meshtastic.app.ai.appfunctions.MeshtasticAppFunctions
@@ -36,7 +37,8 @@ class GoogleMeshUtilApplication :
// Start the AppFunctions enabled-state sync. Resolved here (after startKoin has bound
// androidContext) rather than via createdAtStart so that Koin graphs built outside a
// running app — verification tests, previews — stay lazily constructible.
getKoin().get<AppFunctionStateSync>()
// Off-main: construction forces the AppFunctionsPrefs subgraph and fires AppSearch binder calls.
applicationScope.launch { getKoin().get<AppFunctionStateSync>() }
}
override val appFunctionConfiguration: AppFunctionConfiguration