-
-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PublicAPI: GPS won't activate, when tracking starts while screen is off #1653
Comments
Would you be able to record a video (with a 2nd device) of what is happening? What is technically happening:
This may be problematic due to:
|
I've recorded a logcat and from what it looks like, it is no problem to create a foreground service while in standby, but the access to GPS is denied then: To better understand what I'm doing, I've also recorded it with a second phone. First Situation: Phone is on the homescreen - when the training starts, you can see the GPS-Icon on the right side of the status bar and GPS gets locked quickly: Phone_at_homescreen.mp4Second: The phone is in standby when the training starts. After powering on, you can see that there's no GPS-Icon in the status bar and OpenTracks is stuck on "starting GPS": Phone_in_standby.mp4 |
Location access denied. Are you able to add (and request) the location background permission?
|
I've tested it with the ACCESS_BACKGROUND_LOCATION permission and now it works fine! |
Fixed with 3910837 |
Sadly, requesting ACCESS_BACKGROUND_LOCATION is broken. Likely the actual issue is: https://stackoverflow.com/questions/66475027/activityresultlauncher-with-requestmultiplepermissions-contract-doesnt-show-per |
Sorry to hear that. On a fresh install the app would then ask for all permissions except ACCESS_BACKGROUND_LOCATION and as soon as the public api gets enabled, it would only ask for that additional permission. What do you think? |
Sounds like a good plan. |
And this one becomes related; #1259 |
Hmm.. I guess the whole permission requester class will need a bit of refactoring to get both the background-access and permissions on demand running... |
@v-schaefer what did you try? |
First I tried splitting up the permission request to first request everything except GPS background permission and after that only the GPS background permission. |
Sounds like a good plan. To request these permissions in the same activity: no clue how this is done as I never tried this :D PS/ I would skip implementing UI elements for this. |
I'm seeing a similar issue (I think). I'm starting recording from Home Assistant by sending an intent through the HomeAssistant app to Tasker and Tasker sends the intent to OT when I leave the house with my dogs. I think, at least in my phone, it's a deep sleep issue. When I turn the phone on, even if I turn it off straight afterwards, the recording starts straight away. However, if I forget that, I get the notification from the Home Assistant app that I'm on a dogwalk but it takes between 30 seconds and forever for OT to fire up. App information
Device information
Firmware
|
I use OpenTracks in combination with Gadgedbridge and a Fossil HR watch.
Whenever I start a training on my watch (for example cycling or running) and my phone is in standby, OpenTracks doesn't activate GPS.
The message title in the statusbar stays stuck at "starting GPS" and my training will get recorded without GPS. The phone also doesn't show the symbol that an app is accessing GPS.
However if my phone is on (for example at the homescreen) and I start a new training from my watch, then GPS gets started immediately, the phone shows that GPS is getting accessed by an app and everything works fine.
All battery optimization options on Android are disabled for OpenTracks.
...
Checklist
Technical information
The text was updated successfully, but these errors were encountered: