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

Release references to native objects when destoy() called #7856

Merged
merged 2 commits into from
Aug 28, 2024

Conversation

DzmitryFomchyn
Copy link
Contributor

Description

Release references to native objects when MapboxNavigation.destoy() called

Screenshots or Gifs

TODO

@DzmitryFomchyn DzmitryFomchyn requested a review from a team as a code owner August 23, 2024 16:37
Copy link

github-actions bot commented Aug 23, 2024

Changelog

Features

  • Optimized memory usage in Directions API model classes by interning frequently occurring strings in JSON. [#7840](https://github.com/mapbox/mapbox-navigation-android/pull/7840)
  • The PredictiveCacheController(PredictiveCacheOptions) constructor is now deprecated. Use PredictiveCacheController(MapboxNavigation, PredictiveCacheOptions) instead. [#7856](https://github.com/mapbox/mapbox-navigation-android/pull/7856)

Bug fixes and improvements

  • Fixed UI jank caused by on-device TextToSpeech player. [#7833](https://github.com/mapbox/mapbox-navigation-android/pull/7833)
  • Fixed an issue where native memory was not being properly released after the MapboxNavigation object was destroyed. [#7856](https://github.com/mapbox/mapbox-navigation-android/pull/7856)

Known issues ⚠️

Other changes

Android Auto Changelog

Features

Bug fixes and improvements

  • The app is now considered as the one in active navigation only when an active route is set to MapboxNavigation. Previously it was always considered active. [#7366](https://github.com/mapbox/mapbox-navigation-android/pull/7366)
  • When Android Auto host tells the app to stop active navigation because another app starts navigating, now SDK will enter FreeDrive mode instead of stopping trip session completely. [#7366](https://github.com/mapbox/mapbox-navigation-android/pull/7366)

* accepts [MapboxNavigation] instance.
*
* @param predictiveCacheOptions [PredictiveCacheOptions] options to instantiate instance of [PredictiveCacheController]
* @throws IllegalStateException if [MapboxNavigation] was not instantiated before
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This behavior is not breaking, it just makes crash explicit. In the previous version of this class it would crash in createNavigationController if MapboxNavigation was not instantiated.

Now the behavior is clear, we explicitly ask for MapboxNavigation with which predictive cache will be associated.

Copy link

codecov bot commented Aug 23, 2024

Codecov Report

Attention: Patch coverage is 20.87912% with 72 lines in your changes missing coverage. Please review.

Project coverage is 74.10%. Comparing base (95377ec) to head (58943b8).
Report is 1 commits behind head on main.

Files Patch % Lines
...on/navigator/internal/MapboxNativeNavigatorImpl.kt 0.00% 35 Missing ⚠️
...vigation/core/trip/session/eh/RoadObjectMatcher.kt 0.00% 14 Missing ⚠️
...ox/navigation/ui/maps/PredictiveCacheController.kt 50.00% 10 Missing ⚠️
...avigation/core/trip/session/eh/RoadObjectsStore.kt 0.00% 6 Missing ⚠️
...x/navigation/core/trip/session/eh/GraphAccessor.kt 0.00% 5 Missing ⚠️
...ava/com/mapbox/navigation/core/MapboxNavigation.kt 66.66% 0 Missing and 1 partial ⚠️
...box/navigation/core/NavigationComponentProvider.kt 0.00% 1 Missing ⚠️

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #7856      +/-   ##
============================================
- Coverage     74.18%   74.10%   -0.08%     
+ Complexity     6262     6260       -2     
============================================
  Files           856      856              
  Lines         33793    33809      +16     
  Branches       4022     4027       +5     
============================================
- Hits          25068    25053      -15     
- Misses         7169     7199      +30     
- Partials       1556     1557       +1     
Files Coverage Δ
...mapbox/navigation/core/internal/PredictiveCache.kt 92.47% <100.00%> (+0.16%) ⬆️
.../navigation/core/trip/session/MapboxTripSession.kt 84.75% <100.00%> (+0.21%) ⬆️
...gation/navigator/internal/MapboxNativeNavigator.kt 0.00% <ø> (ø)
...ava/com/mapbox/navigation/core/MapboxNavigation.kt 72.41% <66.66%> (-0.07%) ⬇️
...box/navigation/core/NavigationComponentProvider.kt 56.00% <0.00%> (ø)
...x/navigation/core/trip/session/eh/GraphAccessor.kt 18.18% <0.00%> (ø)
...avigation/core/trip/session/eh/RoadObjectsStore.kt 6.89% <0.00%> (ø)
...ox/navigation/ui/maps/PredictiveCacheController.kt 58.47% <50.00%> (-14.36%) ⬇️
...vigation/core/trip/session/eh/RoadObjectMatcher.kt 5.30% <0.00%> (ø)
...on/navigator/internal/MapboxNativeNavigatorImpl.kt 0.00% <0.00%> (ø)

@DzmitryFomchyn DzmitryFomchyn merged commit 8bcfda1 into main Aug 28, 2024
40 of 45 checks passed
@DzmitryFomchyn DzmitryFomchyn deleted the df-release-native-refs branch August 28, 2024 14:31
DzmitryFomchyn added a commit that referenced this pull request Aug 28, 2024
* Release references to native objects when destoy() called

* Rename changelog files
DzmitryFomchyn added a commit that referenced this pull request Aug 29, 2024
)

* Release references to native objects when destoy() called

* Rename changelog files
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