Position tracking stops recording while the screen is off on Android
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- android
- Domain
- mobile-dev
Research direction
Start at the Position tracking entry point and inspect the Android manifest, foreground-service setup, runtime permission flow, and lifecycle behavior when the screen locks. Reproduce on Android 12 or newer using the listed Samsung or Motorola devices, then verify that coordinates continue recording with the notification visible until Stop tracking is tapped.
Written by the indexing model from the issue text.
Description
Description
During Position tracking on Android, the app stops recording coordinates as soon as the screen turns off (display timeout or device lock) and resumes when the screen is on again. The recorded track shows a gap for the whole period the screen was off. The manifest already declares the location foreground service pieces (FOREGROUND_SERVICE_LOCATION), so this looks like a runtime or lifecycle issue rather than only a missing permission.
Reported by @lmotta
Environment
Production
Application (+ app version, build, operating system)
Android, Samsung device (Android 12 or newer)
(Samsung A56, Motorola One Action)
Steps to reproduce
- Open a project with tracking enabled.
- Start Position tracking from the app (button tap, app in the foreground).
- Move so coordinates are recorded, and confirm the tracking notification is shown.
- Let the screen turn off or lock the device.
- Keep moving for several minutes, turn the screen back on, and inspect the track.
Actual results
Recording pauses while the screen is off, the track has a gap, and it only resumes when the screen is turned back on.
Expected results
Tracking keeps recording continuously while the screen is off, with the notification visible, until Stop tracking is tapped.
Likely root causes
A few possibilities that might be worth checking:
- No wake lock during a tracking session. The manifest does not declare WAKE_LOCK, so when the device enters Doze with the screen off, CPU may sleep between fixes and updates could pause.
- OEM battery optimization. On Samsung in particular, the tracking process may be getting suspended while the screen is off, since MM does not seem to request an exemption from battery optimization.
- Background location permission. ACCESS_BACKGROUND_LOCATION is not declared, so the system permission screen only offers up to "Allow while using the app" and never "Allow all the time". It might be worth declaring it and requesting it at runtime, so users can grant constant location access for tracking.
- Dominant language
- C++
- Stars
- 389
- Forks
- 88
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 23
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MerginMaps/mobile
-
bug iOS 🍎 ui/ux
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
MerginMaps/mobile#4744 ·
Maintainers usually reply within 2 days
-
bluetooth bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
MerginMaps/mobile#4741 ·
Maintainers usually reply within 2 days
-
bug ui/ux
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
MerginMaps/mobile#4669 ·
Maintainers usually reply within 2 days
-
bug Good first issue ui/ux
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
MerginMaps/mobile#4665 ·
Maintainers usually reply within 2 days
-
bug ui/ux
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
MerginMaps/mobile#4647 · 1 comment ·
Maintainers usually reply within 2 days
All issues in MerginMaps/mobile
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
objectionary/eo-graphs#80 ·
-
bug C/C++ code
Difficulty 1/5 Under an hour Newbie friendliness 78/100
webarkit/WebARKitLib#85 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
[request] vsg/1.1.16Openupstream update
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
conan-io/conan-center-index#31142 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100