-
-
Notifications
You must be signed in to change notification settings - Fork 674
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
Clean up location manager after making updates suspend #4818
base: master
Are you sure you want to change the base?
Clean up location manager after making updates suspend #4818
Conversation
app/src/full/java/io/homeassistant/companion/android/sensors/LocationSensorManager.kt
Outdated
Show resolved
Hide resolved
By removing |
well i did not consider that was trying to remove overlapping coroutines think the latest commit should address this and leave just the setup pieces and notification commands as just suspend along with ensuring we dont hit the 100 geofence limit |
OK I think this is good now but am always a bit hesitant with location tracking changes. Do you want to update the docs to mention the geofence limit? (And also specifically how it impacts with the extended zones for high accuracy) |
agreed they are not fun to review nor make changes on
yes we should do that, let me write something up when i get a free moment and link it here |
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.
Moving initial setup to not run async looks good to me, but should probably get one beta cycle before being pushed
Summary
Noticed that we had a few places to clean up and remove overlapping suspend calls
also added in a flush location call to only be called when we need to restart location services to clear out the queue, its also recommended we call it as we use
setMaxWaitTime()
so this felt like the most appropriate place to call it.geofences are also limited to 100 per app so adding in 2 condition checks there. Probably needs a docs update for this one and combined with high accuracy expanded mode will be fun to write 🙃
https://developer.android.com/develop/sensors-and-location/location/geofencing
Screenshots
Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#1141
Any other notes
Tested these changes overnight to ensure it all still works as expected