organicmaps/organicmaps
GitHub で見る[android] Disable compass sensors update when it is not needed
Open
#9,196 opened on 2024年9月1日
AndroidBattery and PerformanceGood first issueNavigationTrack Recording
Repository metrics
- Stars
- (7,887 stars)
- PR merge metrics
- (平均マージ 13d 6h) (30d で 91 merged PRs)
説明
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