diff options
author | Leonard Kugis <leonard@kug.is> | 2024-01-02 17:53:12 +0100 |
---|---|---|
committer | Leonard Kugis <leonard@kug.is> | 2024-01-02 17:53:12 +0100 |
commit | 5db0bdfdf62ae0915b587399a0ff4ce53bca813b (patch) | |
tree | 538a18ce0adbf6e600ee77a48e51d8c67649b0c6 /core | |
parent | 298dff2a877680e928b37e3a1336dc7d7aa52dfb (diff) |
Implemented route mode
Diffstat (limited to 'core')
3 files changed, 35 insertions, 5 deletions
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 <https://www.gnu.org/licenses/>. + */ + + 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<Boolean> - val fakeLocationEnabled: StateFlow<Boolean> - fun setFakeLocationEnabled(enabled: Boolean) - var fakeAltitude: Float var fakeSpeed: Float var fakeJitter: Float var fakeLocation: Pair<Float, Float> - val locationMode: MutableStateFlow<LocationMode> + var routeLoopEnabled: Boolean + var route: List<FakeLocationCoordinate> + + val locationMode: StateFlow<LocationMode> + fun setLocationMode(mode: LocationMode) fun setIpScramblingSetting(enabled: Boolean) val ipScramblingSetting: StateFlow<Boolean> |