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 service stopping more reliable #767

Merged
merged 4 commits into from
Nov 22, 2018

Conversation

davidgyoung
Copy link
Member

@davidgyoung davidgyoung commented Nov 7, 2018

Several changes to make the library behave properly when starting and stopping a foreground service on Android O+, and properly switching back to scan jobs when the foreground service is not active.

  • Add a stopSelf() call when the last consumer is unbound from the scanning service to attempt to make service destruction (and force stopping scanning) more reliable. Call stopForeground() before the call to stopSelf() to prevent a crash.
  • Stop intent based scanning whenever stopping the ScanJob, so it is not left on (potentially launching Scan Jobs again on detection even when the BeaconService is active in the foreground).

@NickRimmer NickRimmer mentioned this pull request Nov 13, 2018
@davidgyoung davidgyoung merged commit c9c8419 into master Nov 22, 2018
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.

1 participant