osmandapp / OsmAnd

OsmAnd
https://osmand.net
Other
4.7k stars 1.02k forks source link

Remove background service completely #3217

Closed sonora closed 7 years ago

sonora commented 8 years ago

Reminder (and follow-up to #3185): I suggest that GPS WAKEUP can now be treated solely as a backstage parameter, and is controlled automatically via user-activated functionality like logging, navigation, or maybe an additional checkbox "Keep GPS running until app is terminated" (useful in some rarer use cases).

There is no need for a user to directly manipulate our background service or its parameters, see discussion here: https://github.com/osmandapp/Osmand/commit/1c4ab5c7afad3f7b977fef9eb355e87be6297d36

vshcherb commented 8 years ago

GPS wake up parameter was used for a different reason, to keep gps active without any service running in order to speed up the cold start of gps. Nowadays cold start has significantly improved as I see and this feature could be totally removed. The times it was introduced cold start was taking 10-15 minutes having screen on all the time was quite difficult.

sonora commented 8 years ago

My use of "GPS_WAKEUP" was a bit heuristic. To be more precise:

I am talking about when we start or stop the navigation service startNavigationService(int intent, int interval) and controlling its parameter "interval".

We have automated code when user-selected functionality is started like startNavigationService(NavigationService.USED_BY_GPX, interval < 30000? 0 : interval);or startNavigationService(NavigationService.USED_BY_LIVE, 0); and that's all that should be needed. No extra dialog to manipulate the background service directly should be available.

(This is not really related to GPS cold start, rather to when our app requires the GPS background service and with what timing to perform functionality selected and when not.)

vshcherb commented 8 years ago

My suggestion people to use Trip recording cause this background service is just very difficult to explain nowadays )

sonora commented 8 years ago

Yes, exactly, I think we are saying the same thing! Let's be 100% function-oriented, and "background service" is a thing of the past, nothing a user should see. We will have only use-case related functionality like "trip recording", "navigation", etc.

I think that this commit would basically achieve that (I had tested it): https://github.com/osmandapp/Osmand/commit/1c4ab5c7afad3f7b977fef9eb355e87be6297d36

sonora commented 7 years ago

I guess my old commit https://github.com/osmandapp/Osmand/commit/1c4ab5c7afad3f7b977fef9eb355e87be6297d36 is still the way to achieve this, had already tested in a separate branch a long time ago, I remember.