Skip to content

Commit

Permalink
NN 161.1.1 (#7626)
Browse files Browse the repository at this point in the history
  • Loading branch information
VysotskiVadim committed Nov 23, 2023
1 parent 50ef0b0 commit 8508ba3
Show file tree
Hide file tree
Showing 9 changed files with 6,692 additions and 189 deletions.
1 change: 1 addition & 0 deletions changelog/unreleased/bugfixes/7626.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fixed an issue when navigation could switch between alternative routes in cycle when a user moves backward.
1 change: 1 addition & 0 deletions changelog/unreleased/issues/7626.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Seamless switch to a route alternative doesn't always work for multi legs routes, regular reroute happens instead.
2 changes: 1 addition & 1 deletion gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ext {
// version which we should use in this build
def mapboxNavigatorVersion = System.getenv("FORCE_MAPBOX_NAVIGATION_NATIVE_VERSION")
if (mapboxNavigatorVersion == null || mapboxNavigatorVersion == '') {
mapboxNavigatorVersion = '161.1.0'
mapboxNavigatorVersion = '161.1.1'
}
println("Navigation Native version: " + mapboxNavigatorVersion)

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ class RefreshTtlTest : BaseCoreNoCleanUpTest() {
mapboxNavigation.registerRoutesInvalidatedObserver { invalidatedResults.add(it) }
stayOnPosition(coordinates[0].latitude(), coordinates[0].longitude(), 190f) {
val routes = mapboxNavigation.requestRoutes(routeOptions)
.getSuccessfulResultOrThrowException().routes
.getSuccessfulResultOrThrowException().routes.take(1)
mockWebServerRule.requestHandlers.clear()
mockWebServerRule.requestHandlers.add(
MockDirectionsRequestHandler(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.mapbox.navigation.instrumentation_tests.utils.location

import android.location.Location
import com.mapbox.geojson.Point
import com.mapbox.navigation.core.MapboxNavigation
import com.mapbox.navigation.core.internal.extensions.flowLocationMatcherResult
import com.mapbox.navigation.testing.ui.BaseCoreNoCleanUpTest
Expand Down Expand Up @@ -52,6 +53,21 @@ suspend fun BaseCoreNoCleanUpTest.stayOnPosition(
)
}

suspend fun BaseCoreNoCleanUpTest.stayOnPosition(
point: Point,
bearing: Float,
frequencyHz: Int = 1,
block: suspend () -> Unit
) {
stayOnPosition(
latitude = point.latitude(),
longitude = point.longitude(),
bearing = bearing,
frequencyHz = frequencyHz,
block = block,
)
}

suspend fun BaseCoreNoCleanUpTest.stayOnPositionAndWaitForUpdate(
mapboxNavigation: MapboxNavigation,
latitude: Double,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@ class MockLocationReplayerRule(mockLocationUpdatesRule: MockLocationUpdatesRule)
mapboxReplayer = null
}

fun playRoute(directionsRoute: DirectionsRoute) {
fun playRoute(
directionsRoute: DirectionsRoute,
eventsToDrop: Int = 0
) {
val replayEvents = mapper.mapDirectionsRouteGeometry(directionsRoute)
.drop(eventsToDrop)
mapboxReplayer?.clearEvents()
mapboxReplayer?.pushEvents(replayEvents)
mapboxReplayer?.seekTo(replayEvents.first())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,30 @@ object RoutesProvider {
)
}

fun dc_short_with_alternative_same_beginning(context: Context): MockRoute {
val jsonResponse = readRawFileText(
context,
R.raw.route_response_dc_short_with_alternative_same_begining
)
val coordinates = listOf(
Point.fromLngLat(-77.02821219854371,38.887758247504166),
Point.fromLngLat(-77.03002,38.895453)
)
return MockRoute(
jsonResponse,
DirectionsResponse.fromJson(jsonResponse),
listOf(
MockDirectionsRequestHandler(
profile = DirectionsCriteria.PROFILE_DRIVING_TRAFFIC,
jsonResponse = jsonResponse,
expectedCoordinates = coordinates
)
),
coordinates,
emptyList()
)
}

fun dc_short_two_legs_with_alternative(context: Context): MockRoute {
val jsonResponse = readRawFileText(context, R.raw.route_response_dc_very_short_two_legs_alternative)
val coordinates = listOf(
Expand Down
Loading

0 comments on commit 8508ba3

Please sign in to comment.