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

Make MapboxNavigationApp.setup create new instance #6288

Merged
merged 2 commits into from
Sep 8, 2022

Conversation

kmadsen
Copy link
Contributor

@kmadsen kmadsen commented Sep 8, 2022

Description

We have been discussing an issue where the examples need to call disable to have their new NavigationOptions accepted by the MapboxNavigationApp

The solution was to add a disable into the "orchestrating" activity. Which is the MainActivity that helps you select different examples.

The problem with that is that it breaks Android Auto while you're selecting an example. The whole point of this is to make the examples work well with Android Auto.

Why this new solution is being considered desirable, is because there is a MapboxNavigationApp.isSetup function available. If you really do not want to trigger a recreation, that option is available. The new setup function puts more trust into the caller that they know setup will trigger a new instance of MapboxNavigation.

@kmadsen kmadsen requested a review from a team as a code owner September 8, 2022 16:37
@kmadsen kmadsen force-pushed the km-make-setup-create-new-instance branch from 765ea8a to ba07b01 Compare September 8, 2022 16:39
@kmadsen
Copy link
Contributor Author

kmadsen commented Sep 8, 2022

Note that Android Auto still has issues with each example in the phone re-creating different versions of MapboxNavigation. Those issues will be resolved by this #6141

@codecov
Copy link

codecov bot commented Sep 8, 2022

Codecov Report

Merging #6288 (4406ce4) into main (56f0e32) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #6288      +/-   ##
============================================
- Coverage     68.83%   68.82%   -0.01%     
  Complexity     4414     4414              
============================================
  Files           663      663              
  Lines         26493    26490       -3     
  Branches       3111     3111              
============================================
- Hits          18236    18233       -3     
  Misses         7075     7075              
  Partials       1182     1182              
Impacted Files Coverage Δ
...tion/core/lifecycle/MapboxNavigationAppDelegate.kt 90.90% <100.00%> (-0.76%) ⬇️

@kmadsen kmadsen force-pushed the km-make-setup-create-new-instance branch from ba07b01 to 830cae8 Compare September 8, 2022 17:42
@kmadsen kmadsen force-pushed the km-make-setup-create-new-instance branch from 830cae8 to 0d9ae0e Compare September 8, 2022 18:05
@kmadsen
Copy link
Contributor Author

kmadsen commented Sep 8, 2022

static-analysis failed with the same issue i'm finding over here #6234 (comment)

@kmadsen kmadsen force-pushed the km-make-setup-create-new-instance branch from c16510c to 4406ce4 Compare September 8, 2022 19:06
@@ -598,6 +598,7 @@ jobs:

static-analysis:
executor: ndk-r22-latest-executor
resource_class: medium+
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kmadsen kmadsen merged commit b520e54 into main Sep 8, 2022
@kmadsen kmadsen deleted the km-make-setup-create-new-instance branch September 8, 2022 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants