diff options
Diffstat (limited to 'app/src/main/java/foundation/e/advancedprivacy/domain/usecases')
-rw-r--r-- | app/src/main/java/foundation/e/advancedprivacy/domain/usecases/FakeLocationStateUseCase.kt | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/app/src/main/java/foundation/e/advancedprivacy/domain/usecases/FakeLocationStateUseCase.kt b/app/src/main/java/foundation/e/advancedprivacy/domain/usecases/FakeLocationStateUseCase.kt index b7743df..1f92554 100644 --- a/app/src/main/java/foundation/e/advancedprivacy/domain/usecases/FakeLocationStateUseCase.kt +++ b/app/src/main/java/foundation/e/advancedprivacy/domain/usecases/FakeLocationStateUseCase.kt @@ -54,7 +54,7 @@ class FakeLocationStateUseCase( coroutineScope: CoroutineScope ) { private val _configuredLocationMode = MutableStateFlow<FakeLocationState>( - FakeLocationState(LocationMode.REAL_LOCATION, null, null, null, null, null, null, false, null, false, false) + FakeLocationState(LocationMode.REAL_LOCATION, null, null, null, null, null, null, null, null, null, null, false, null, false, false) ) val configuredLocationMode: StateFlow<FakeLocationState> = _configuredLocationMode @@ -120,6 +120,10 @@ class FakeLocationStateUseCase( null, null, null, + null, + null, + null, + null, false, localStateRepository.route, isEnabled, @@ -129,13 +133,17 @@ class FakeLocationStateUseCase( localStateRepository.routeLoopEnabled = isEnabled } - fun setFakeLocationParameters(altitude: Float, speed: Float, jitter: Float) { + fun setFakeLocationParameters(altitude: Float, speed: Float, bearing: Float, jitter: Float, jitterAltitude: Float, jitterSpeed: Float, jitterBearing: Float) { _configuredLocationMode.value = FakeLocationState( LocationMode.SPECIFIC_LOCATION, null, altitude, speed, + bearing, jitter, + jitterAltitude, + jitterSpeed, + jitterBearing, localStateRepository.fakeLocation.first, localStateRepository.fakeLocation.second, false, @@ -146,7 +154,11 @@ class FakeLocationStateUseCase( localStateRepository.fakeAltitude = altitude localStateRepository.fakeSpeed = speed + localStateRepository.fakeBearing = bearing localStateRepository.fakeJitter = jitter + localStateRepository.fakeJitterAltitude = jitterAltitude + localStateRepository.fakeJitterSpeed = jitterSpeed + localStateRepository.fakeJitterBearing = jitterBearing } fun useRealLocation() { @@ -158,6 +170,10 @@ class FakeLocationStateUseCase( null, null, null, + null, + null, + null, + null, false, null, false, @@ -183,7 +199,11 @@ class FakeLocationStateUseCase( null, localStateRepository.fakeAltitude, localStateRepository.fakeSpeed, + localStateRepository.fakeBearing, localStateRepository.fakeJitter, + localStateRepository.fakeJitterAltitude, + localStateRepository.fakeJitterSpeed, + localStateRepository.fakeJitterBearing, location.first, location.second, false, @@ -197,7 +217,11 @@ class FakeLocationStateUseCase( localStateRepository.setLocationMode(LocationMode.SPECIFIC_LOCATION) fakeLocationModule.setFakeLocation(localStateRepository.fakeAltitude.toDouble(), localStateRepository.fakeSpeed, + localStateRepository.fakeBearing, localStateRepository.fakeJitter, + localStateRepository.fakeJitterAltitude.toDouble(), + localStateRepository.fakeJitterSpeed, + localStateRepository.fakeJitterBearing, localStateRepository.fakeLocation.first.toDouble(), localStateRepository.fakeLocation.second.toDouble()) } else { @@ -215,6 +239,10 @@ class FakeLocationStateUseCase( null, null, null, + null, + null, + null, + null, false, route ?: localStateRepository.route, localStateRepository.routeLoopEnabled, @@ -235,6 +263,10 @@ class FakeLocationStateUseCase( null, null, null, + null, + null, + null, + null, false, route, localStateRepository.routeLoopEnabled, @@ -253,6 +285,10 @@ class FakeLocationStateUseCase( null, null, null, + null, + null, + null, + null, false, localStateRepository.route, localStateRepository.routeLoopEnabled, |