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

Android location stream not cancelling #1153

Merged
merged 2 commits into from Oct 14, 2022

Conversation

Wackymax
Copy link
Contributor

✨ What kind of change does this PR introduce? (Bug fix, feature, docs update...)

Bug fix

⤵️ What is the current behavior?

Currently when the location stream is cancelled the geolocator background service does not fully shutdown correctly.

🆕 What is the new behavior (if this is a feature change)?

This fixes the check for when multiple flutter engines are connected and location stream is explicitly being cancelled by the user instead of being cancelled by the activity process getting destroyed.

💥 Does this PR introduce a breaking change?

No

🐛 Recommendations for testing

  1. Set the Android foreground config. Start the location stream and shortly after stop it. The foreground notification should be removed when the service shuts down.
  2. When using a background service like flutter_background_service and starting the geolocator stream in the background service and then killing the main activity should not stop the geolocator service and it should continue to send position updates to the background service

📝 Links to relevant issues/docs

#1142
#986

🤔 Checklist before submitting

  • I made sure all projects build.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy.
  • I updated CHANGELOG.md to add a description of the change.
  • I followed the style guide lines (code style guide).
  • I updated the relevant documentation.
  • I rebased onto current master.

@codecov
Copy link

codecov bot commented Oct 14, 2022

Codecov Report

Base: 100.00% // Head: 98.29% // Decreases project coverage by -1.70% ⚠️

Coverage data is based on head (bff0d44) compared to base (85b45ff).
Patch has no changes to coverable lines.

Additional details and impacted files
@@             Coverage Diff             @@
##              main    #1153      +/-   ##
===========================================
- Coverage   100.00%   98.29%   -1.71%     
===========================================
  Files           13        3      -10     
  Lines          236      117     -119     
===========================================
- Hits           236      115     -121     
- Misses           0        2       +2     
Impacted Files Coverage Δ
...ocator_android/lib/src/types/android_settings.dart 100.00% <ø> (ø)
...or_platform_interface/lib/src/models/position.dart
...terface/lib/src/extensions/integer_extensions.dart
...e/lib/src/errors/already_subscribed_exception.dart
...rm_interface/lib/src/models/location_settings.dart
...rors/permission_request_in_progress_exception.dart
...terface/lib/src/geolocator_platform_interface.dart
...ce/lib/src/errors/permission_denied_exception.dart
...src/implementations/method_channel_geolocator.dart
...face/lib/src/errors/position_update_exception.dart
... and 7 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Wackymax
Copy link
Contributor Author

@mvanbeusekom I didn't make changes to the dart code so not sure what the codecov is complaining about?

Copy link
Member

@mvanbeusekom mvanbeusekom left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for fixing this @Wackymax

@mvanbeusekom mvanbeusekom merged commit 57b82e9 into Baseflow:main Oct 14, 2022
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.

None yet

2 participants