Skip to content

Commit

Permalink
add telem percent time in foreground and in portrait track support
Browse files Browse the repository at this point in the history
  • Loading branch information
Guardiola31337 committed Oct 27, 2017
1 parent 0743009 commit 2d93319
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -812,4 +812,22 @@ public void addAbsoluteDistanceToDestination(int absoluteDistanceToDestination,
Hashtable<String, Object> eventWithAttributes) {
eventWithAttributes.put(MapboxNavigationEvent.KEY_ABSOLUTE_DISTANCE_TO_DESTINATION, absoluteDistanceToDestination);
}

// 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 addPercentTimeInForeground(@IntRange(from = 0, to = 100) int percentTimeInForeground,
Hashtable<String, Object> eventWithAttributes) {
eventWithAttributes.put(MapboxNavigationEvent.KEY_PERCENT_TIME_IN_FOREGROUND, percentTimeInForeground);
}

// 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 addPercentTimeInPortrait(@IntRange(from = 0, to = 100) int percentTimeInPortrait,
Hashtable<String, Object> eventWithAttributes) {
eventWithAttributes.put(MapboxNavigationEvent.KEY_PERCENT_TIME_IN_PORTRAIT, percentTimeInPortrait);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ private void sendEventsWrapped(Vector<Hashtable<String, Object>> events, Callbac
jsonObject.putOpt(MapboxNavigationEvent.KEY_LOCATION_ENGINE, evt.get(MapboxNavigationEvent.KEY_LOCATION_ENGINE));
jsonObject.putOpt(MapboxNavigationEvent.KEY_ABSOLUTE_DISTANCE_TO_DESTINATION,
evt.get(MapboxNavigationEvent.KEY_ABSOLUTE_DISTANCE_TO_DESTINATION));
jsonObject.putOpt(MapboxNavigationEvent.KEY_PERCENT_TIME_IN_FOREGROUND,
evt.get(MapboxNavigationEvent.KEY_PERCENT_TIME_IN_FOREGROUND));
jsonObject.putOpt(MapboxNavigationEvent.KEY_PERCENT_TIME_IN_PORTRAIT,
evt.get(MapboxNavigationEvent.KEY_PERCENT_TIME_IN_PORTRAIT));

// Step metadata
jsonObject.putOpt(MapboxNavigationEvent.KEY_UPCOMING_INSTRUCTION,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ public class MapboxNavigationEvent {
public static final String KEY_STEP_COUNT = "stepCount";
public static final String KEY_LOCATION_ENGINE = "locationEngine";
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";

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

0 comments on commit 2d93319

Please sign in to comment.