Loading app/build.gradle +6 −3 Original line number Diff line number Diff line Loading @@ -115,6 +115,10 @@ android { dataBinding true viewBinding true } lintOptions { disable 'MissingTranslation' } } dependencies { Loading @@ -130,6 +134,8 @@ dependencies { implementation 'foundation.e:privacymodule.tor:1.2.0-orbot-16.6.2' implementation 'foundation.e:elib:0.0.1-alpha11' implementation ( Libs.Kotlin.stdlib, Libs.AndroidX.coreKtx, Loading @@ -150,9 +156,6 @@ dependencies { debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.9.1' testImplementation 'junit:junit:4.+' androidTestImplementation 'androidx.test.ext:junit:1.1.2' androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' implementation 'foundation.e:elib:0.0.1-alpha11' } static def log(Object val) { Loading app/src/androidTest/java/foundation/e/privacycentralapp/ExampleInstrumentedTest.ktdeleted 100644 → 0 +0 −39 Original line number Diff line number Diff line /* * Copyright (C) 2021 E FOUNDATION * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ package foundation.e.privacycentralapp import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.platform.app.InstrumentationRegistry import org.junit.Assert import org.junit.Test import org.junit.runner.RunWith /** * Instrumented test, which will execute on an Android device. * * See [testing documentation](http://d.android.com/tools/testing). */ @RunWith(AndroidJUnit4::class) class ExampleInstrumentedTest { @Test fun useAppContext() { // Context of the app under test. val appContext = InstrumentationRegistry.getInstrumentation().targetContext Assert.assertEquals("foundation.e.privacycentralapp", appContext.packageName) } } app/src/main/java/foundation/e/privacycentralapp/DependencyContainer.kt +14 −12 Original line number Diff line number Diff line Loading @@ -106,7 +106,8 @@ class DependencyContainer(val app: Application) { ) } val viewModelsFactory by lazy { ViewModelsFactory( val viewModelsFactory by lazy { ViewModelsFactory( getQuickPrivacyStateUseCase = getQuickPrivacyStateUseCase, trackersStatisticsUseCase = trackersStatisticsUseCase, trackersStateUseCase = trackersStateUseCase, Loading @@ -114,7 +115,8 @@ class DependencyContainer(val app: Application) { ipScramblerModule = ipScramblerModule, ipScramblingStateUseCase = ipScramblingStateUseCase, appListUseCase = appListUseCase ) } ) } // Background fun initBackgroundSingletons() { Loading Loading @@ -147,8 +149,8 @@ class ViewModelsFactory( return when (modelClass) { AppTrackersViewModel::class.java -> { val fallbackUid = android.os.Process.myPid() val appUid = extras[DEFAULT_ARGS_KEY]?. getInt(AppTrackersFragment.PARAM_APP_UID, fallbackUid)?: fallbackUid val appUid = extras[DEFAULT_ARGS_KEY] ?.getInt(AppTrackersFragment.PARAM_APP_UID, fallbackUid) ?: fallbackUid AppTrackersViewModel( appUid = appUid, Loading app/src/main/java/foundation/e/privacycentralapp/PrivacyCentralApplication.kt +0 −2 Original line number Diff line number Diff line Loading @@ -19,14 +19,12 @@ package foundation.e.privacycentralapp import android.app.Application import com.mapbox.mapboxsdk.Mapbox import kotlinx.coroutines.FlowPreview class PrivacyCentralApplication : Application() { // Initialize the dependency container. val dependencyContainer: DependencyContainer by lazy { DependencyContainer(this) } override fun onCreate() { super.onCreate() Mapbox.getTelemetry()?.setUserTelemetryRequestState(false) Loading app/src/main/java/foundation/e/privacycentralapp/UpdateTrackersWorker.kt +3 −2 Original line number Diff line number Diff line Loading @@ -45,7 +45,8 @@ class UpdateTrackersWorker(appContext: Context, workerParams: WorkerParameters) fun periodicUpdate(context: Context) { val request = PeriodicWorkRequestBuilder<UpdateTrackersWorker>( 7, TimeUnit.DAYS) 7, TimeUnit.DAYS ) .setConstraints(constraints).build() WorkManager.getInstance(context).enqueueUniquePeriodicWork( Loading Loading
app/build.gradle +6 −3 Original line number Diff line number Diff line Loading @@ -115,6 +115,10 @@ android { dataBinding true viewBinding true } lintOptions { disable 'MissingTranslation' } } dependencies { Loading @@ -130,6 +134,8 @@ dependencies { implementation 'foundation.e:privacymodule.tor:1.2.0-orbot-16.6.2' implementation 'foundation.e:elib:0.0.1-alpha11' implementation ( Libs.Kotlin.stdlib, Libs.AndroidX.coreKtx, Loading @@ -150,9 +156,6 @@ dependencies { debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.9.1' testImplementation 'junit:junit:4.+' androidTestImplementation 'androidx.test.ext:junit:1.1.2' androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' implementation 'foundation.e:elib:0.0.1-alpha11' } static def log(Object val) { Loading
app/src/androidTest/java/foundation/e/privacycentralapp/ExampleInstrumentedTest.ktdeleted 100644 → 0 +0 −39 Original line number Diff line number Diff line /* * Copyright (C) 2021 E FOUNDATION * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ package foundation.e.privacycentralapp import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.platform.app.InstrumentationRegistry import org.junit.Assert import org.junit.Test import org.junit.runner.RunWith /** * Instrumented test, which will execute on an Android device. * * See [testing documentation](http://d.android.com/tools/testing). */ @RunWith(AndroidJUnit4::class) class ExampleInstrumentedTest { @Test fun useAppContext() { // Context of the app under test. val appContext = InstrumentationRegistry.getInstrumentation().targetContext Assert.assertEquals("foundation.e.privacycentralapp", appContext.packageName) } }
app/src/main/java/foundation/e/privacycentralapp/DependencyContainer.kt +14 −12 Original line number Diff line number Diff line Loading @@ -106,7 +106,8 @@ class DependencyContainer(val app: Application) { ) } val viewModelsFactory by lazy { ViewModelsFactory( val viewModelsFactory by lazy { ViewModelsFactory( getQuickPrivacyStateUseCase = getQuickPrivacyStateUseCase, trackersStatisticsUseCase = trackersStatisticsUseCase, trackersStateUseCase = trackersStateUseCase, Loading @@ -114,7 +115,8 @@ class DependencyContainer(val app: Application) { ipScramblerModule = ipScramblerModule, ipScramblingStateUseCase = ipScramblingStateUseCase, appListUseCase = appListUseCase ) } ) } // Background fun initBackgroundSingletons() { Loading Loading @@ -147,8 +149,8 @@ class ViewModelsFactory( return when (modelClass) { AppTrackersViewModel::class.java -> { val fallbackUid = android.os.Process.myPid() val appUid = extras[DEFAULT_ARGS_KEY]?. getInt(AppTrackersFragment.PARAM_APP_UID, fallbackUid)?: fallbackUid val appUid = extras[DEFAULT_ARGS_KEY] ?.getInt(AppTrackersFragment.PARAM_APP_UID, fallbackUid) ?: fallbackUid AppTrackersViewModel( appUid = appUid, Loading
app/src/main/java/foundation/e/privacycentralapp/PrivacyCentralApplication.kt +0 −2 Original line number Diff line number Diff line Loading @@ -19,14 +19,12 @@ package foundation.e.privacycentralapp import android.app.Application import com.mapbox.mapboxsdk.Mapbox import kotlinx.coroutines.FlowPreview class PrivacyCentralApplication : Application() { // Initialize the dependency container. val dependencyContainer: DependencyContainer by lazy { DependencyContainer(this) } override fun onCreate() { super.onCreate() Mapbox.getTelemetry()?.setUserTelemetryRequestState(false) Loading
app/src/main/java/foundation/e/privacycentralapp/UpdateTrackersWorker.kt +3 −2 Original line number Diff line number Diff line Loading @@ -45,7 +45,8 @@ class UpdateTrackersWorker(appContext: Context, workerParams: WorkerParameters) fun periodicUpdate(context: Context) { val request = PeriodicWorkRequestBuilder<UpdateTrackersWorker>( 7, TimeUnit.DAYS) 7, TimeUnit.DAYS ) .setConstraints(constraints).build() WorkManager.getInstance(context).enqueueUniquePeriodicWork( Loading