Skip to content

Commit 2fe22ae

Browse files
authored
Create RouteProgress after leg index check in RouteProcessorRunnable (#1657)
1 parent d11f0e6 commit 2fe22ae

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/navigation/RouteProcessorBackgroundThread.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ public synchronized void start() {
3838
if (workerHandler == null) {
3939
workerHandler = new Handler(getLooper());
4040
}
41-
runnable = new RouteProcessorRunnable(
42-
routeProcessor, navigation, workerHandler, responseHandler, listener
43-
);
41+
runnable = new RouteProcessorRunnable(routeProcessor, navigation, workerHandler, responseHandler, listener);
4442
workerHandler.post(runnable);
4543
}
4644

@@ -53,11 +51,11 @@ public boolean quit() {
5351
}
5452

5553
void updateRawLocation(Location rawLocation) {
54+
navigation.retrieveMapboxNavigator().updateLocation(rawLocation);
5655
if (!isAlive()) {
5756
start();
5857
}
5958
runnable.updateRawLocation(rawLocation);
60-
navigation.retrieveMapboxNavigator().updateLocation(rawLocation);
6159
}
6260

6361
/**

libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/navigation/RouteProcessorRunnable.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,8 @@ private void process() {
5757

5858
NavigationStatus status = mapboxNavigator.retrieveStatus(new Date(),
5959
options.navigationLocationEngineIntervalLagInMilliseconds());
60-
RouteProgress routeProgress = routeProcessor.buildNewRouteProgress(status, route);
61-
6260
status = checkForNewLegIndex(mapboxNavigator, route, status, options.enableAutoIncrementLegIndex());
61+
RouteProgress routeProgress = routeProcessor.buildNewRouteProgress(status, route);
6362

6463
NavigationEngineFactory engineFactory = navigation.retrieveEngineFactory();
6564
final boolean userOffRoute = isUserOffRoute(options, status, rawLocation, routeProgress, engineFactory);

0 commit comments

Comments
 (0)