Local-NLP-Backend icon indicating copy to clipboard operation
Local-NLP-Backend copied to clipboard

Location scanning seems stuck on in 1.2.0-beta.3

Open ProjectMoon opened this issue 3 years ago • 22 comments

Love the update to Deja Vu.

I noticed that my location indicator was stuck "on" while using Local NLP Backend. It was not microG using the location either, but rather Local NLP Backend itself. Not sure what it was doing, but the location indicator was on for many many minutes. I don't know if this is intended behavior. No GPS app was running either. Phone was otherwise idle.

I had to kill the app to make it stop attempting to acquire location. I also noticed that afterwards when trying to manually scan from the NLP settings, it didn't work until I toggled Local NLP Backend off and on in the microG settings.

ProjectMoon avatar Sep 09 '22 14:09 ProjectMoon

I'm not sure what you mean with "location indicator". Is it the icon showing that some app requests a GPS location? If yes, this really should not happen.

Local NLP Backend should never request GPS location, but only receive location if some other app uses GPS. And this GPS monitoring code is unchanged taken from Deja Vu. The manual scan only requests a network location, but not GPS...

Which Android version are you using? All my testing was done on Android 9, so I fear there may be issues with changed behavior in newer versions.

Helium314 avatar Sep 09 '22 20:09 Helium314

Screenshot_20220910-132415

I'm on Android 12, Calyx OS 3.8.0. When the backend is enabled, this indicator just says that Local NLP Backend is always using the location.

ProjectMoon avatar Sep 10 '22 11:09 ProjectMoon

When the backend is disabled, the location use stops.

ProjectMoon avatar Sep 10 '22 11:09 ProjectMoon

Could you test whether the same thing happens if you use GPSLogger and set it to only use passive location provider? This basically does the same: it always checks whether some other app uses GPS, and fetches the GPS locations.

If not, then the issue may be that Local NLP Backend still targets API 28 (Android 9). There are some differences and new background location permission in newer API versions...

Helium314 avatar Sep 10 '22 11:09 Helium314

On Android 11 (LOS 18) both backends are in the list. 55db1e7b-3302-47a9-be85-2a219be8a9e6

DocSniper avatar Sep 11 '22 12:09 DocSniper

@ProjectMoon could you try whether it also happens when the app targets API 33? APK You may need to disable and enable again, so microG asks for background location permission. If it doesn't work you can simply install previous beta3 apk over it again.

Helium314 avatar Sep 11 '22 13:09 Helium314

So the new APK seems to work much better. Location doesn't get stuck on. But the backend does acquire location by itself separately sometimes. Don't know if that's intentional or not.

ProjectMoon avatar Sep 11 '22 18:09 ProjectMoon

But the backend does acquire location by itself separately sometimes

I don't know what this exactly means... maybe Android 12 reports WiFi scanning as acquiring location. If this is the case probably there is nothing I can do. How is it with DejaVu? Does it also appear to be scanning location permanently?

Helium314 avatar Sep 11 '22 19:09 Helium314

Don't think I've ever seen deja Vu scan for location. But then again, I've never checked. It definitely doesn't get stuck on permanently though.

What does mean is that the location in use indicator shows up periodically as "location in use by local NLP Backend." Wifi scanning is a likely culprit. How often does it scan?

ProjectMoon avatar Sep 12 '22 05:09 ProjectMoon

WiFi scans happen when any app requests a network based location (via microG), or when the device gets a GPS position.

Helium314 avatar Sep 12 '22 21:09 Helium314

Actually you could check whether the WiFi scans cause the issues: In the settings you can simply disable WiFi scanning (under Use WiFi locations).

This is not a solution, as the locations will be very inaccurate, but at least this way we know whether WiFi scanning is causing the "being used by..." to show up. (you can also try disabling cell tower locations if WiFI locations doesn't change anything...)

Helium314 avatar Sep 17 '22 11:09 Helium314

I actually currently have wifi scanning turned off. Didn't even know it was off.

ProjectMoon avatar Sep 17 '22 14:09 ProjectMoon

Do you mean we wifi scanning in the app? Or android settings?

ProjectMoon avatar Sep 17 '22 15:09 ProjectMoon

I mean in the app, in the settings you can access via microG.

Helium314 avatar Sep 17 '22 15:09 Helium314

Turned off the wifi scans in the app, and it still grabs location sometimes.

ProjectMoon avatar Sep 20 '22 14:09 ProjectMoon

I can confirm the issue with the permanent location on. Happened to me on two devices with Android 8.1 and 10.

famo avatar Nov 05 '22 22:11 famo

Android 8 doesn't have an indicator as shown in https://github.com/Helium314/Local-NLP-Backend/issues/2#issuecomment-1242711610. On Android 8 there only is a GPS indicator that shows when GPS is being used. But 1.2.0-beta.3 doesn't even have the capability of enabling GPS.

Can you maybe describe what you mean?

Helium314 avatar Nov 07 '22 21:11 Helium314

Well, the location icon is permanently displayed (ie. location is requested) in the status bar. Normally you enable location and the icon only pops up once you actually have a location request (eg opened a map app). I hope this makes it more clear...?

famo avatar Nov 11 '22 18:11 famo

So this is the GPS indicator then... Android 8 doesn't show any icon when only network based location is requested, as far as I know.

Which version are you using? Ability to enable GPS was only added in 1.2.1 (active mode in settings), but it's disabled by default, and additionally it shows a notification when GPS is enabled.

Helium314 avatar Nov 12 '22 07:11 Helium314

I'm using Version 1.2.2-beta.1 from F-Droid repo. And the active mode is disabled (everything was left to default values).

famo avatar Nov 13 '22 12:11 famo

So how does it happen? If you enable the backend, the location symbol shows up, and if you disable it the symbol is gone?

Does the same happen when you use DejaVu? If not, do you remember if this also happened in 1.2.0? Is there a notification shown?

Helium314 avatar Nov 16 '22 12:11 Helium314

Not sure how relevant, the location warning comes up when viewing the location module details in MicroG and goes away soon afterwards. LOS20 and 1.2.5.

Mrnofish avatar Apr 22 '23 06:04 Mrnofish