diff options
author | Guillaume Jacquart <guillaume.jacquart@hoodbrains.com> | 2022-02-24 08:02:48 +0000 |
---|---|---|
committer | Guillaume Jacquart <guillaume.jacquart@hoodbrains.com> | 2022-02-24 08:02:48 +0000 |
commit | 13b6d0463fe7fa5cc5586b677e17d38a0fd5d0dd (patch) | |
tree | 57a1abab362668e92b7c0f9c124c663a54222a02 | |
parent | 323d28aa26beace64186a33a0557e2e7ad4771af (diff) | |
parent | 1399a9e7910ff7e79a8ebd55f4460c4c83d8b635 (diff) |
Merge branch 'make_persistent' into 'main'
Start service on boot and flag persistent
See merge request e/privacy-central/privacycentralapp!18
4 files changed, 14 insertions, 3 deletions
diff --git a/app/build.gradle b/app/build.gradle index 3c026ff..8812137 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -16,6 +16,8 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + manifestPlaceholders = [ persistent: "false" ] + resValue("string", "mapbox_key", MAPBOX_KEY) } @@ -64,6 +66,8 @@ android { signingConfig null // Set signing config to null as we use signingConfig per variant. } release { + manifestPlaceholders = [ persistent: "true" ] + minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 756fd0e..d00e4d7 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -18,6 +18,7 @@ android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" + android:persistent="${persistent}" android:supportsRtl="true" android:theme="@style/Theme.PrivacyCentralApp" android:windowSoftInputMode="adjustResize" 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() } } |