From b23034b28453d5b9421009dfd7e94790dde24f6e Mon Sep 17 00:00:00 2001 From: Leonard Kugis Date: Fri, 5 Jan 2024 14:23:49 +0100 Subject: FakeLocationService: Resetting route time correctly. --- .../e/advancedprivacy/fakelocation/services/FakeLocationService.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fakelocation/src/main/java/foundation/e') diff --git a/fakelocation/src/main/java/foundation/e/advancedprivacy/fakelocation/services/FakeLocationService.kt b/fakelocation/src/main/java/foundation/e/advancedprivacy/fakelocation/services/FakeLocationService.kt index 41784a1..5136ec9 100644 --- a/fakelocation/src/main/java/foundation/e/advancedprivacy/fakelocation/services/FakeLocationService.kt +++ b/fakelocation/src/main/java/foundation/e/advancedprivacy/fakelocation/services/FakeLocationService.kt @@ -126,6 +126,7 @@ class FakeLocationService : Service() { Actions.START_ROUTE -> { route = Gson().fromJson(it.getStringExtra(PARAM_ROUTE) ?: "[]", object : TypeToken>() {}.type) loopRoute = it.getBooleanExtra(PARAM_ROUTE_LOOP, false) + routeTime = 0f initTimerRoute() } else -> {} @@ -226,7 +227,6 @@ class FakeLocationService : Service() { private fun initTimerRoute() { cdtRoute?.cancel() - routeTime = 0f cdtRoute = object : CountDownTimer(PERIOD_UPDATES_SERIE, PERIOD_LOCATION_UPDATE) { override fun onTick(millisUntilFinished: Long) { var coord = calculateRouteSegment() -- cgit v1.2.1