organicmaps/organicmaps

[android] Disable compass sensors update when it is not needed

Open

#9.196 aberto em 1 de set. de 2024

Ver no GitHub
 (5 comments) (0 reactions) (0 assignees)C++ (761 forks)batch import
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:

  1. When the map is visible (and the arrow on the map is visible)
  2. When the Place Page is visible with a small blue arrow pointing to the selected place
  3. 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

Guia do colaborador