organicmaps/organicmaps
Ver no GitHub[android] Disable compass sensors update when it is not needed
Open
#9.196 aberto em 1 de set. de 2024
AndroidBattery and PerformanceGood first issueNavigationTrack Recording
Métricas do repositório
- Stars
- (7.887 stars)
- Métricas de merge de PR
- (Mesclagem média 13d 6h) (91 fundiu PRs em 30d)
Description
Compass updates are needed only in a limited number of places:
- When the map is visible (and the arrow on the map is visible)
- When the Place Page is visible with a small blue arrow pointing to the selected place
- When a small blue arrow from (2) is tapped and a big pointing arrow is displayed
Everywhere else compass (sensor) updates are not needed and should be disabled. Now they are always enabled.
The system should automatically pause compass updates when the app is in the background. But it does not happen when a foreground service is active. Meaning that active navigation and active track recording when OM is in the background will unnecessarily consume the battery.
CC @rtsisyk @kavikhalique