Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ internal object MapboxNavigationTelemetry :
logger: Logger?,
locationsCollector: LocationsCollector = LocationsCollectorImpl(logger)
) {
reset()
sessionState = IDLE
this.logger = logger
this.locationsCollector = locationsCollector
navigationOptions = options
Expand Down Expand Up @@ -278,9 +280,7 @@ internal object MapboxNavigationTelemetry :
if (dynamicValues.sessionStarted) {
log("sessionStop")
handleSessionCanceled()
dynamicValues.reset()
resetOriginalRoute()
resetRouteProgress()
reset()
}
}

Expand Down Expand Up @@ -427,6 +427,14 @@ internal object MapboxNavigationTelemetry :
}
}

private fun reset() {
dynamicValues.reset()
resetOriginalRoute()
resetRouteProgress()
needHandleReroute = false
needStartSession = false
}

private fun resetRouteProgress() {
log("resetRouteProgress")
routeProgress = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import com.mapbox.navigation.core.telemetry.events.NavigationRerouteEvent
import com.mapbox.navigation.metrics.MapboxMetricsReporter
import com.mapbox.navigation.metrics.internal.event.NavigationAppUserTurnstileEvent
import io.mockk.Runs
import io.mockk.coEvery
import io.mockk.every
import io.mockk.just
import io.mockk.mockk
Expand All @@ -47,10 +46,8 @@ import junit.framework.TestCase.assertEquals
import junit.framework.TestCase.assertNotSame
import junit.framework.TestCase.assertTrue
import org.junit.After
import org.junit.Ignore
import org.junit.Test

@Ignore
class MapboxNavigationTelemetryTest {

private companion object {
Expand Down Expand Up @@ -592,7 +589,7 @@ class MapboxNavigationTelemetryTest {
}

private fun mockLocationCollector() {
coEvery { locationsCollector.flushBuffers() } just Runs
every { locationsCollector.flushBuffers() } just Runs
every { locationsCollector.lastLocation } returns lastLocation
every { lastLocation.latitude } returns LAST_LOCATION_LAT
every { lastLocation.longitude } returns LAST_LOCATION_LON
Expand Down