From 5db0bdfdf62ae0915b587399a0ff4ce53bca813b Mon Sep 17 00:00:00 2001 From: Leonard Kugis Date: Tue, 2 Jan 2024 17:53:12 +0100 Subject: Implemented route mode --- .../domain/entities/FakeLocationCoordinate.kt | 28 ++++++++++++++++++++++ .../domain/entities/LocationMode.kt | 2 +- .../domain/repositories/LocalStateRepository.kt | 10 ++++---- 3 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 core/src/main/java/foundation/e/advancedprivacy/domain/entities/FakeLocationCoordinate.kt (limited to 'core/src') diff --git a/core/src/main/java/foundation/e/advancedprivacy/domain/entities/FakeLocationCoordinate.kt b/core/src/main/java/foundation/e/advancedprivacy/domain/entities/FakeLocationCoordinate.kt new file mode 100644 index 0000000..a7992a9 --- /dev/null +++ b/core/src/main/java/foundation/e/advancedprivacy/domain/entities/FakeLocationCoordinate.kt @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2024 Leonard Kugis + * + * 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 . + */ + + package foundation.e.advancedprivacy.domain.entities + + data class FakeLocationCoordinate( + val latitude: Float, + val longitude: Float, + val altitude: Float, + val speed: Float, + val jitter: Float, + val bearing: Float, + ) + \ No newline at end of file diff --git a/core/src/main/java/foundation/e/advancedprivacy/domain/entities/LocationMode.kt b/core/src/main/java/foundation/e/advancedprivacy/domain/entities/LocationMode.kt index 3642fcc..a82e7d0 100644 --- a/core/src/main/java/foundation/e/advancedprivacy/domain/entities/LocationMode.kt +++ b/core/src/main/java/foundation/e/advancedprivacy/domain/entities/LocationMode.kt @@ -19,5 +19,5 @@ package foundation.e.advancedprivacy.domain.entities enum class LocationMode { - REAL_LOCATION, RANDOM_LOCATION, SPECIFIC_LOCATION + REAL_LOCATION, RANDOM_LOCATION, SPECIFIC_LOCATION, ROUTE } diff --git a/core/src/main/java/foundation/e/advancedprivacy/domain/repositories/LocalStateRepository.kt b/core/src/main/java/foundation/e/advancedprivacy/domain/repositories/LocalStateRepository.kt index 641f6da..34bc096 100644 --- a/core/src/main/java/foundation/e/advancedprivacy/domain/repositories/LocalStateRepository.kt +++ b/core/src/main/java/foundation/e/advancedprivacy/domain/repositories/LocalStateRepository.kt @@ -21,6 +21,7 @@ import foundation.e.advancedprivacy.domain.entities.ApplicationDescription import foundation.e.advancedprivacy.domain.entities.FeatureState import foundation.e.advancedprivacy.domain.entities.LocationMode import foundation.e.advancedprivacy.domain.entities.MainFeatures +import foundation.e.advancedprivacy.domain.entities.FakeLocationCoordinate import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.SharedFlow import kotlinx.coroutines.flow.StateFlow @@ -31,16 +32,17 @@ interface LocalStateRepository { val areAllTrackersBlocked: MutableStateFlow - val fakeLocationEnabled: StateFlow - fun setFakeLocationEnabled(enabled: Boolean) - var fakeAltitude: Float var fakeSpeed: Float var fakeJitter: Float var fakeLocation: Pair - val locationMode: MutableStateFlow + var routeLoopEnabled: Boolean + var route: List + + val locationMode: StateFlow + fun setLocationMode(mode: LocationMode) fun setIpScramblingSetting(enabled: Boolean) val ipScramblingSetting: StateFlow -- cgit v1.2.1