package org.incido.compose import android.app.Application import org.incido.compose.data.security.SecurityManager import org.incido.compose.di.AppContainer /** * Application class. Constructs the singleton [AppContainer] holding the * ObjectBox store and the note repository. * * M4.3: the screens reach the container through `LocalAppGraph` (provided * by `IncidoApp`); the graph-based ViewModel factories (`factory(graph)`) * no longer touch the Application through CreationExtras. The Application * still owns construction order. * * v0.3.2.0 — initialises the [SecurityManager] lock state during * `onCreate` so the first composition of the root Compose tree * already knows whether to render `PinEntryScreen` or jump straight * into the regular UI. */ class IncidoApplication : Application() { lateinit var container: AppContainer private set val securityManager: SecurityManager get() = container.securityManager override fun onCreate() { super.onCreate() container = AppContainer(this) // Decide whether to start locked based on the persisted // security preferences. Safe here — no UI thread contention // because we're on the main thread pre-Activity. container.securityManager.start() } }