From 1399a9e7910ff7e79a8ebd55f4460c4c83d8b635 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquart Date: Thu, 24 Feb 2022 08:02:48 +0000 Subject: Start service on boot and flag persistent --- .../java/foundation/e/privacycentralapp/DependencyContainer.kt | 10 +++++++--- .../e/privacycentralapp/PrivacyCentralApplication.kt | 2 ++ 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'app/src/main/java') diff --git a/app/src/main/java/foundation/e/privacycentralapp/DependencyContainer.kt b/app/src/main/java/foundation/e/privacycentralapp/DependencyContainer.kt index ceb8202..c8d7fb2 100644 --- a/app/src/main/java/foundation/e/privacycentralapp/DependencyContainer.kt +++ b/app/src/main/java/foundation/e/privacycentralapp/DependencyContainer.kt @@ -43,7 +43,6 @@ import foundation.e.privacymodules.permissions.data.ApplicationDescription import foundation.e.privacymodules.trackers.api.BlockTrackersPrivacyModule import foundation.e.privacymodules.trackers.api.TrackTrackersPrivacyModule import kotlinx.coroutines.GlobalScope -import lineageos.blockers.BlockerInterface /** * Simple container to hold application wide dependencies. @@ -110,8 +109,6 @@ class DependencyContainer constructor(val app: Application) { ) } - val blockerService = BlockerInterface.getInstance(context) - val internetPrivacyViewModelFactory by lazy { InternetPrivacyViewModelFactory(ipScramblerModule, getQuickPrivacyStateUseCase, ipScramblingStateUseCase, appListUseCase) } @@ -123,4 +120,11 @@ class DependencyContainer constructor(val app: Application) { val appTrackersViewModelFactory by lazy { AppTrackersViewModelFactory(trackersStateUseCase, trackersStatisticsUseCase, getQuickPrivacyStateUseCase) } + + // Background + fun initBackgroundSingletons() { + trackersStateUseCase + ipScramblingStateUseCase + fakeLocationStateUseCase + } } diff --git a/app/src/main/java/foundation/e/privacycentralapp/PrivacyCentralApplication.kt b/app/src/main/java/foundation/e/privacycentralapp/PrivacyCentralApplication.kt index e6081f1..28e96e0 100644 --- a/app/src/main/java/foundation/e/privacycentralapp/PrivacyCentralApplication.kt +++ b/app/src/main/java/foundation/e/privacycentralapp/PrivacyCentralApplication.kt @@ -28,5 +28,7 @@ class PrivacyCentralApplication : Application() { override fun onCreate() { super.onCreate() Mapbox.getTelemetry()?.setUserTelemetryRequestState(false) + + dependencyContainer.initBackgroundSingletons() } } -- cgit v1.2.1