GPS does not work when screen is off or app not on top

Hello,
I have purchased a Fairphone 4 last week and am still in the process of configuring it.
A serious problem I encountered was that GPS does not work whenever the screen is turned off or the app that is using it is not on top. If I switch to another app it can’t use GPS either.
I first encountered the problem using Oruxmaps but Google Maps has the same problem.
Since I often use my phone to record tracks while hiking or driving my bicycle this is kind of a dealbreaker for me because I can’t keep the screen switched on the whole day.

Here’s my information:

  • Android 11 with Android security update 5. April 2022
  • App info for Oruxmaps → Battery → Battery optimisation: Not optimised (Background restriction option is greyed out)
  • Battery → Battery Saver: Off

Apart from the fact that Maps complains about missing GPS and the recorded track in Oruxmaps jumps directly whenever I switch on the display, everything is working find.
Whenever I actually use GPS, it finds its satellites quickly enough and the precision is absolutely fine.

Did I miss any settings that will help me out?
Thank You!

1 Like

Hello and welcome to the forum. I haven’t really tried running any kind of navigation when the screen is turned off. (I might try it tomorrow.) But I noticed that my location history (Google Maps Timeline) has been a mess lately. It is inaccurate as hell, usually showing only the points where I turned the screen on. I get that it is not supposed to be extremely accurate as that would drain the battery a lot. But it used to be way better. You can try disabling battery optimizations for “Fused Location”. But if that doesn’t work, I’m out of options. Anyway, please make sure to #contactsupport. This is pretty weird and it should definitely be addressed.

Thank you for your response.
I disabled optimization for Fused Location and unfortunately it did not solve my problem.

I’ve tried it today and it’s exactly how you described it. The moment I turned off the screen, Google Maps were unable to get GPS signal. That’s pretty disappointing.

Strange, I recently tracked a walk with Google Fit while listening to Podcast/YT Music. That worked fine, the walk was mapped in detail. No gaps. I’ll try this evening when I’ll commute with Google Maps.

Hello together,

I’m using Google Maps together with Android Auto (wireless and wired) and the screen of my FP4 is off during the navigation.
I didn’t noticed any problems with navigation while I’m using Android Auto.

So, I don’t think it’s directly a problem with Google Maps, otherwise Android Auto would have massive problems with navigation.

Is this issue also reported to support? If not, please #contactsupport. I’ll try to reproduce the issue as well.

I already contacted support.
But since I purchased the Fairphone from an “other” vendor I have to wait 30 days. (I am sure not getting any support from that vendor)
And yes, it certainly isn’t a problem of Google Maps or Android Auto since I already know Oruxmaps is also affected.
Thank you for confirming that not everybody is having that problem.
I found one person on the internet that had a similar problem with his phone and managed to fix it by upgrading to Android 12. I am hesitant to do that because Fairphone will make that jump eventually.

I just tested Google Maps and Komoot with live navigation while the screen was off and it worked with my FP4 on latest Android update without problems, see attachment:
Rennradtour.gpx (14.3 KB)

You can upload this file to websites, likes this one:

Best regards
Julian

1 Like

I really can’t reproduce this. Can some more people share their experiences? Because it’s already on the wiki of reproducible issues, I think that might be too soon.

Using the stock ROM, latest update, tested with GMaps. It has never failed me, also not now :slight_smile: I’m not using any fancy system alterations either. It’s a very much stock setup.

To better understand the issue, maybe create a screencast? Then we can see what really happens. Please also share any tweaks you applied to your device.

Well, I was able to reproduce it. I also have a response from support:

This may happen if the location permission given to the app was “While using the app”. In that case, shortly after the screen turns off, it’s not actively being used and the location service will turn off. Thus, I would suggest to check your permissions for the apps concerned!

I set it to Allow all the time and I plan to test it in approx. an hour when I’ll be driving.

7 Likes

Ah okay! I missed that comment. In that case it works as designed. I’ll remove it from the wiki since this is not the kind of issue that should be there :slight_smile:

2 Likes

Agreed. I tried it with the location permission set to “Allow all the time” and sure enough, it worked even when I turned the screen off. It seems that since Android 10, apps must specifically ask for the background location permission (android.permission.ACCESS_BACKGROUND_LOCATION), more info here.

We might eventually make a new wiki page with common issues that are not strictly related to Fairphone (e.g., permissions in new Android versions, features that are not in vanilla/FP Android but people are used to them from other phones, etc.).

4 Likes

That fixed it for me!
Thank you very, very much!

1 Like

Sounds like a plan. Also the lack of VoLTE support with some carriers causes issues that are not universal enough for that wiki I started. But could be something for a wiki you mention. As well as SD card issues.

1 Like

I also have a similar problem, but with a different application - the Beeline motorcycle navigation.

I have been in contact with the developers of the application and they have informed me that they are not using the android.permission.ACCESS_BACKGROUND_LOCATION, instead they are using the standard foreground permissions, even when the screen is turned off. There is no “allow all the time” option available for this application.

The phone seems to kill the process anyway and the navigation gets very infrequent location updates while the screen is turned off. I have already investigated location permissions and battery optimization settings. I wanted to attach them here as screenshots for completeness, but new users are restricted. I guess one screenshot showing the approximate frequency of location updates will be enough for now.

Here is citation from the Beeline developer

Background permission doesn’t mean when your app is in the background. Background location updates are a special case for apps requiring location updates when the app is not running. Our app is running when navigating, so we correctly use the foreground permission using a foreground service. Changing to background permission would not change anything. It’s likely the choice of phone is to blame here or they haven’t excluded our app from being killed by the battery manager.

Anyway, if you require more information to investigate this issue please let me know.

Anyone there? I’d really appreciate some help with this.

Hi Jakub and welcome to the community forum!

I expect the others will get back to you but in any case you should #contactsupport . Make sure you include the comments from the Beeline dev. From what you wrote it looks like you’ve already checked things covered in this topic.

It may be that the FPOS is not implementing permissions as it should.

Could you

  • indicate the build number of the OS version that you are running
  • test with Google Maps
1 Like

The fairphone build is FP4.FP3V.A.116.20220414

Google maps works fine, but it actually uses the background permission, which the beeline appliaction does not. The background data is gathered at higher frequency than in the Beeline screenshot, although it still looks a little lower than I would expect. But that’s background, and Beeline is supposed to run exclusively in foreground. In foreground, with navigation active, whether with the display turned on or off Google maps work just fine and the turn-by-turn directions arrive on time.

Yes, if it’s not working when not visible, I rather get the impression that Beeline should be implementing a foreground service (as per the Android documentation referred to above by Razem). When the app is running but not visible, do you see a “Location” icon in the status bar? If not, then the app has neglected to declare the foreground service type of Location, which it appears is obligatory from A10 up.

2 Likes