Skip to content

Commit

Permalink
add telem cancel rating and comment track support
Browse files Browse the repository at this point in the history
  • Loading branch information
Guardiola31337 committed Oct 27, 2017
1 parent 5d474aa commit a3c940d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -830,4 +830,21 @@ public void addPercentTimeInPortrait(@IntRange(from = 0, to = 100) int percentTi
Hashtable<String, Object> eventWithAttributes) {
eventWithAttributes.put(MapboxNavigationEvent.KEY_PERCENT_TIME_IN_PORTRAIT, percentTimeInPortrait);
}

// For internal use only
// This is an experimental API. Experimental APIs are quickly evolving and
// might change or be removed in minor versions.
@Experimental
public void addRatingToCancel(@IntRange(from = -1, to = 100) int rating,
Hashtable<String, Object> eventWithAttributes) {
eventWithAttributes.put(MapboxNavigationEvent.KEY_RATING, rating);
}

// For internal use only
// This is an experimental API. Experimental APIs are quickly evolving and
// might change or be removed in minor versions.
@Experimental
public void addCommentToCancel(String comment, Hashtable<String, Object> eventWithAttributes) {
eventWithAttributes.put(MapboxNavigationEvent.KEY_COMMENT, comment);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ private void sendEventsWrapped(Vector<Hashtable<String, Object>> events, Callbac
jsonObject.putOpt(MapboxNavigationEvent.KEY_DISTANCE, evt.get(MapboxNavigationEvent.KEY_DISTANCE));
jsonObject.putOpt(MapboxNavigationEvent.KEY_ORIGINAL_STEP_COUNT,
evt.get(MapboxNavigationEvent.KEY_ORIGINAL_STEP_COUNT));
jsonObject.putOpt(MapboxNavigationEvent.KEY_RATING, evt.get(MapboxNavigationEvent.KEY_RATING));
jsonObject.putOpt(MapboxNavigationEvent.KEY_COMMENT, evt.get(MapboxNavigationEvent.KEY_COMMENT));

// Build the JSON but only if there's a value for it in the evt
jsonObject.putOpt(MapboxEvent.KEY_EVENT, evt.get(MapboxEvent.KEY_EVENT));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ public class MapboxNavigationEvent {
public static final String KEY_ABSOLUTE_DISTANCE_TO_DESTINATION = "absoluteDistanceToDestination";
public static final String KEY_PERCENT_TIME_IN_FOREGROUND = "percentTimeInForeground";
public static final String KEY_PERCENT_TIME_IN_PORTRAIT = "percentTimeInPortrait";
public static final String KEY_RATING = "rating";
public static final String KEY_COMMENT = "comment";

// Step metadata
public static final String KEY_UPCOMING_INSTRUCTION = "upcomingInstruction";
Expand Down

0 comments on commit a3c940d

Please sign in to comment.