bfabiszewski / ulogger-android

μlogger • android application for real-time collection and publishing of geolocation data
GNU General Public License v3.0
307 stars 52 forks source link

ulogger thinks no network position is availble if GPS is down, and refuses to start/resume logging #76

Closed TjrGithub closed 4 years ago

TjrGithub commented 4 years ago

I cannot resume tracking anymore if ulogger is configured to use both network and GPS, but only network positioning is available from the OS. Instead, a toast pops up that I have to enable at least one positioning source. But I have both GPS and network enabled in the app, and both were delivering data up to ten minutes ago (when I mistakenly swiped to stop tracking. On top of that, when I tap Waypoint, ulogger complains about not finding my position. This has always worked in the past, before the resume-logging-button was redesigned into a neon green slider.

This happens when I deactivate the GPS in the system settings, so that network location is still available, and ulogger is configured to listen on both network and GPS location.

However, when I enable the GPS in the system settings, tapping waypoint will happily get network positioning before it gets a fix, and I can resume logging. If I re-enable logging with this workaround, and then disable GPS from the OS, the sqlite3 database contains all the network positions correctly: select _id,datetime(time,'unixepoch','localtime'),latitude,longitude from positions where provider = 'network' order by _id desc limit 10;

The usage scenario is: I am using uLogger as automated, 24/7 position logging for quantified self purposes. To save battery, I've set LIneageOS system profiles to turn off GPS whenever I'm at home.

OS: LineageOS for MicroG 16.0 https://download.lineage.microg.org/beryllium/lineage-16.0-20200331-microG-beryllium.zip unifiednlplocation backends: deja vu, gsm (both activated and delivering a location) uLogger version: 3.2 settings: active on-device track and maximize data, i.e. minimium interval, no accuracy, both position sources, no ulogger server configured, autostart

The logs, while trying to re-enable logging: [08-04 12:31:55.541 15863:16194 I/ActivityManager] START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=net.fabiszewski.ulogger/.MainActivity bnds=[463,761][667,997]} from uid 10041

[08-04 12:31:56.871 16780:16907 V/NlpLocationProvider] onSetRequest: ProviderRequest[ON interval=+10s0ms lowPowerMode=false] by WorkSource{10115 net.fabiszewski.ulogger}

[08-04 12:31:58.686 728:936 W/SurfaceFlinger] Attempting to set client state on removed layer: net.fabiszewski.ulogger/net.fabiszewski.ulogger.MainActivity#0

[08-04 12:31:58.686 728:936 W/SurfaceFlinger] Attempting to destroy on removed layer: net.fabiszewski.ulogger/net.fabiszewski.ulogger.MainActivity#0

[08-04 12:31:58.687 728:936 W/SurfaceFlinger] Attempting to set client state on removed layer: net.fabiszewski.ulogger/net.fabiszewski.ulogger.MainActivity#0

[08-04 12:31:58.688 728:936 W/SurfaceFlinger] Attempting to destroy on removed layer: net.fabiszewski.ulogger/net.fabiszewski.ulogger.MainActivity#0

bfabiszewski commented 4 years ago

Thanks for reporting this issue. I can reproduce it so I should be able to fix it soon.

TjrGithub commented 3 years ago

In versions 3.3 and 3.4 Fdroid, the bug is stil there.