-
- All Implemented Interfaces:
-
com.appsflyer.internal.components.di.ServiceLocator
public final class SdkServiceLocator implements ServiceLocator
Every cached dependency is held in a CachedDependency, so concurrent first calls to a getter always produce a single instance (DELIVERY-129908). Getters that cannot cache unconditionally - feature-guarded ones that return
nulland must retry, or ones that take a parameter - create under the same monitor instead; the frequently called ones read a volatile field first, so after creation no getter takes the monitor.Invariants, because every creation holds the locator's monitor:
An initializer must never wait for another thread that resolves a dependency from this locator.
Constructors must stay cheap: defer disk reads, class loading of DexGuard-encrypted classes and thread creation to first use (see DependencyProvider), or another thread's first call to an unrelated getter waits for them.
-
-
Constructor Summary
Constructors Constructor Description SdkServiceLocator()
-
Method Summary
-
-
Method Detail
-
setContext
final Unit setContext(Context context)
Sets context for the other dependencies - make sure to call this in init stage, before trying to get any dependency from service locator.
TODO implement some kind of global init and move context adding to a constructor
-
createAppsFlyerApiService
AppsFlyerApiService createAppsFlyerApiService()
-
getApiCallFactory
ApiCallFactory getApiCallFactory()
-
createHttpClient
HttpClient createHttpClient()
-
getBackgroundExecutor
ExecutorService getBackgroundExecutor()
-
getSerialExecutor
ExecutorService getSerialExecutor()
-
getScheduledBackgroundExecutor
ScheduledExecutorService getScheduledBackgroundExecutor()
-
getSingleScheduledBackgroundExecutor
ScheduledExecutorService getSingleScheduledBackgroundExecutor()
-
getMainThreadScheduler
MainThreadScheduler getMainThreadScheduler()
-
getIdProvider
IdProvider getIdProvider()
-
getAppsflyerPreferences
AppsFlyerPreferences getAppsflyerPreferences()
-
getAppsFlyerProperties
AppsFlyerProperties getAppsFlyerProperties()
-
getPurchaseHandler
PurchaseHandler getPurchaseHandler()
-
getRemoteControl
RemoteControl getRemoteControl()
-
getInstallSourceDataProvider
InstallSourceDataProvider getInstallSourceDataProvider()
-
getMetricsCollector
MetricsCollector getMetricsCollector()
-
getEventDispatcher
EventDispatcher getEventDispatcher()
-
getEventDataCollector
EventDataCollector getEventDataCollector()
-
getSensorManager
AFSensorManager getSensorManager()
-
getTaskQueue
TaskQueue getTaskQueue()
-
getRemoteDebugManager
RemoteDebugManager getRemoteDebugManager()
-
getReferrersManager
ReferrersManager getReferrersManager()
-
getOptionalReferrersProvider
OptionalReferrersProvider getOptionalReferrersProvider()
-
getOptionalFeaturesValidator
OptionalFeaturesValidator getOptionalFeaturesValidator()
-
getLoggerDelegate
LoggerDelegate getLoggerDelegate()
-
getSecureDataProvider
SecureDataProvider getSecureDataProvider()
-
getContextProvider
ContextProvider getContextProvider()
-
getCacheManager
CacheManager getCacheManager()
-
getExceptionManager
ExceptionManager getExceptionManager()
Created only while the optional exception-manager artifact is present;
nullotherwise.
-
getUrlProvider
UrlProvider getUrlProvider()
-
getEventUrlResolver
EventUrlResolver getEventUrlResolver()
-
getPluginDetailsProvider
PluginDetailsProvider getPluginDetailsProvider()
-
getDeeplinkManager
AFDeepLinkManager getDeeplinkManager()
-
getFacebookDDLManager
FacebookDeferredDeeplinkManager getFacebookDDLManager()
-
getBatteryManager
AFBatteryManager getBatteryManager()
-
getDeviceNetworkManager
AFNetworkManager getDeviceNetworkManager()
-
getAFScreenManager
AFScreenManager getAFScreenManager()
-
getAppOpenReferrerManager
AppOpenReferrerManager getAppOpenReferrerManager()
-
getSessionStorage
SessionStorage getSessionStorage()
-
getAndroidLifecycleManager
AndroidLifecycleManager getAndroidLifecycleManager()
-
getLoggerClientsRegistry
LoggerClientsRegistry getLoggerClientsRegistry()
-
getConsentManager
AFConsentManager getConsentManager()
-
getPlayIntegrityApiManager
@WorkerThread() PlayIntegrityApiManager getPlayIntegrityApiManager()
A failed creation is logged and returns
null; the next call retries.
-
getDeeplinkDataStorage
DeeplinkDataStorage getDeeplinkDataStorage()
-
getFeatureFlagManager
FeatureFlagManager getFeatureFlagManager()
-
getAppSetIdManager
AppSetIdManager getAppSetIdManager()
-
getBranchMigrationManager
@Synchronized() BranchMigrationManager getBranchMigrationManager()
Created only while the migration helper is available;
nullotherwise.
-
getAppsFlyerQueueListener
QueueStatusListener getAppsFlyerQueueListener()
-
setConversionDataListener
Unit setConversionDataListener(AppsFlyerConversionListener conversionDataListener)
-
getAppsFlyerConversionListener
AppsFlyerConversionListener getAppsFlyerConversionListener()
-
getSessionReadyManager
SessionReadyManager getSessionReadyManager()
-
-
-
-