SailReal / nina-foss

FOSS implementation of the NINA app
GNU General Public License v3.0
11 stars 0 forks source link

Protect app against Doze and App Standby optimisations #14

Closed SailReal closed 2 years ago

SailReal commented 2 years ago

Please agree to the following

Summary

Replace foreground service with WorkManager

Motivation

As a user, I want to have the app polling for changes regardless of app standby, app deep sleep or something else, the app should simply run forever.

We currently use a foreground service and disable battery optimisations for this app but even both don't protect us completely against Doze, I think we should implement a WorkManager and set something similar to setAndAllowWhileIdle which internally uses an AlarmManager with setAndAllowWhileIdle() or setExactAndAllowWhileIdle() to protect against Doze.

Considered Alternatives

No response

Anything else?

No response

SailReal commented 2 years ago

We use now the AlarmManager directly instead of WorkManager so that we have better control over Doze and App Standby.