Skip to content

Commit

Permalink
Send departure event with a valid distance traveled (#789)
Browse files Browse the repository at this point in the history
* Send departure event with a valid distance traveled

* Remove unnecessary comments
  • Loading branch information
danesfeder authored Mar 22, 2018
1 parent 296c33e commit e1dd605
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ public void onLocationChanged(Location location) {
public void onRouteProgressUpdate(RouteProgress routeProgress) {
this.metricProgress = new MetricsRouteProgress(routeProgress);

if (navigationSessionState.startTimestamp() == null) {
// Set departure timestamp
boolean isValidDeparture = navigationSessionState.startTimestamp() == null
&& routeProgress.currentLegProgress().distanceTraveled() > 0;
if (isValidDeparture) {
navigationSessionState = navigationSessionState.toBuilder()
.startTimestamp(new Date())
.build();
updateLifecyclePercentages();
// Send departure event for the start of this session
NavigationMetricsWrapper.departEvent(navigationSessionState, metricProgress, metricLocation.getLocation());
}
}
Expand Down

0 comments on commit e1dd605

Please sign in to comment.