-
Notifications
You must be signed in to change notification settings - Fork 319
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
NavigationTelemetry update cue for changing configurations #648
Conversation
Hrmm I think we originally had something like this so that if someone were to arrive at a destination, then update the route and start navigating again, it'd start a new session (with a new depart event). We'll probably want to change this at some point with separate That being said, why would startNavigation be called and reset the session ID after arrival but before cancel? |
ece7477
to
d40afa4
Compare
@ericrwolfe I think the issue here was how we look at configuration changes in So what could be happen is I've updated this PR to use our lifecycle monitor class which has access to the activity that launches the |
@danesfeder Fortunately, we were able to see the session ID change in the test app while simulating, so should be easy to verify. Want to run the test app with these changes and ensure the session ID stays consistent all the way from depart -> arrive -> cancel? |
@@ -69,8 +71,10 @@ protected void onDestroy() { | |||
public void onNavigationReady() { | |||
NavigationViewOptions.Builder options = NavigationViewOptions.builder(); | |||
options.navigationListener(this); | |||
extractRoute(options); | |||
extractCoordinates(options); | |||
if (!isConfigurationChange) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ericrwolfe this prevents the UI from calling MapboxNavigation#startNavigation
twice (we already have a cached route in the RouteViewModel
)
@@ -55,6 +55,7 @@ public void onActivityPaused(Activity activity) { | |||
@Override | |||
public void onActivityDestroyed(Activity activity) { | |||
if (activity.isFinishing()) { | |||
NavigationTelemetry.getInstance().endSession(activity.isChangingConfigurations()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ericrwolfe Now we call NavigationTelemetry#endSession
only if the activity is finishing and pass whether it is finishing from a changing config or not.
@@ -169,6 +165,8 @@ void initialize(@NonNull Context context, @NonNull String accessToken, | |||
|
|||
isInitialized = true; | |||
} | |||
// Setup the listeners | |||
initEventDispatcherListeners(navigation); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ericrwolfe the listeners are also added every time we init now instead of the first time. Arrival events weren't firing after rotation because of this (listener would be null).
65a692f
to
4f16ba9
Compare
@Guardiola31337 @devotaaabel this is ready for 👀 whenever you have time 🚀 |
4045298
to
beb2b32
Compare
* master: Update Strings with Transifex Translations (mapbox#657) Added embedded navigation example (mapbox#654) Release 0.9.0 (mapbox#663) Update README.md for 0.9.0 (mapbox#664) Add Maneuver type exit rotary constant (mapbox#653) Update Maps and Services dependencies (mapbox#661) Add FasterRouteDetector to check for quicker routes while navigating (mapbox#638) Directions API Banner instructions (mapbox#582) NavigationTelemetry update cue for changing configurations (mapbox#648) Moved WaypointNavigationActivity from the SDK to the test app (mapbox#652) Exposes the MapboxMap in NavigationView with a getter method (mapbox#642) Add language to NavigationViewOptions with default from RouteOptions (mapbox#635) # Conflicts: # libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/navigation/NavigationEngine.java # libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/navigation/NavigationService.java
Sometimes the session state is updated with a new UUID - this should never happen, so should set it once in the
builder()
cc @ericrwolfe