Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add telem percent time in foreground and in portrait track support #616

Merged
merged 1 commit into from
Oct 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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