-
public class ApplicationService.Companion
-
-
Field Summary
Fields Modifier and Type Field Description public final static ApplicationService.CompanionINSTANCE
-
Method Summary
Modifier and Type Method Description final ApplicationServicegetInstance()Process-wide instance shared between ActivityLifecycleInitializer (which registers lifecycle observation at process start) and dependency injection (which resolves the service later, during SDK init). final ApplicationServicegetInstanceOrNull()The process-wide instance only if ActivityLifecycleInitializer already created one; never creates it. -
-
Method Detail
-
getInstance
final ApplicationService getInstance()
Process-wide instance shared between ActivityLifecycleInitializer (which registers lifecycle observation at process start) and dependency injection (which resolves the service later, during SDK init). Both must reference the same object so the activity lifecycle observed before init is visible to the running SDK.
-
getInstanceOrNull
final ApplicationService getInstanceOrNull()
The process-wide instance only if ActivityLifecycleInitializer already created one; never creates it. Dependency injection uses this so that when the startup initializer did not run (its provider was disabled, or unit tests), each SDK init gets its own instance rather than a leaked process-wide one.
-
-
-
-