paoservis / osmtracker-android

Automatically exported from code.google.com/p/osmtracker-android
GNU General Public License v3.0
0 stars 0 forks source link

Patch: DataHelper: Get most current active track #181

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I've seen that very rarely, the background recording service will get killed 
while recording a track.  If this happens, and then another track is started, 
it's possible for 2 tracks to be marked active.

With this patch, DataHelper.getActiveTrackId sorts its query by id descending, 
so the most recent active track is returned. 

DataHelper.getActiveTrackId is called by TrackManager to get currentTrackId.

Original issue reported on code.google.com by jdmo...@nand.net on 15 Jul 2012 at 1:58

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks I'll have a look. Feel free to make a pull request on GitHub, that's 
easier ;)

Concerning the root cause (service being killed), do you have any idea what 
might be causing that ?

Original comment by nicolas@guillaumin.me on 26 Jul 2012 at 10:50

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
That's a bit tricky: Selecting the greatest ID might not work if a previous 
track was resumed (as opposite to a new track started). In this case the active 
track might not be the one with the greatest ID.

I guess it would be better to fix the service crash in the first place. I tried 
to apply a fix for that (See #158), we'll see if that helps in the next release 
and hopefully we won't have to implement this.

Original comment by nicolas@guillaumin.me on 28 Jul 2012 at 8:35