n76 / DejaVu

Yet another network location backend for the UnifiedNLP/microG project
GNU General Public License v3.0
100 stars 18 forks source link

Turn on GPS when new emitter seen and location unknown #34

Open icjuego opened 4 years ago

icjuego commented 4 years ago

I have a suggestion. Deja Vu could currently monitor for emitters appearing constantly with very low power usage. Then, if Deja Vu sees an emitter it hasn't seen before, it should try and get the most accurate location with low power usage. The logic would be as follows:

  1. A GPS location is already obtained for some other app, we already have an accurate location, use it. (current behaviour)
  2. We can get a network location from Deja Vu or another provider. Use that. Less accurate, but low power.
  3. If the above fails, request a lock on GPS for long enough to get a location, record the details, and release the lock.

This would allow it to minimise GPS usage while updating the database more regularly.

At the moment I find myself forcing a GPS lock for long periods when on longer trips to gather data, which smashes my battery life.

I'd be happy to implement this if you're interested.