AOSP (Pixel, Nexus, …) – alarms and notifications
Source: Don’t kill my app
Explanation
On Pixels and Nexuses you have the least chance something goes wrong with background processing, but still there are several places to look at!
Some use-cases are no more possible or paradoxically more battery consuming (e.g. gathering sensor data through sensor batching,see Solution for developers) with the introduction of Doze mode in Android 6+ and you may need to opt the app out of battery optimizations to make it work properly.
Also a serious doze mode bug in Android 6.0 even prevented foreground services to do their job (see Solution for devs for workaround), but luckily this was fixed in 7.0.
After Android 8 users or even the system (Adaptive battery in Android 9) can decide to prevent your apps background processes from working and you may need to check the Background restrictions (or limits) option in your phone settings.
Solution Android P
There’s a special option in Settings > Apps > Circadian > Advanced > Battery > Background restrictions. If users accidentally enable this option it will break their apps. And users do enable that option!
Pie and pre-Pie
If you see background processing issues, overall it is a good idea to make Circadian not battery optimized to ensure it gets the freedom it needs to perform in the background.
For that:
- Go to Settings > Apps > Circadian > Advanced > Battery > Battery optimization
- Change view to All apps
- Search for Circadian
- Choose Not optimized
Android O
Make sure Settings > Apps > Circadian > Advanced > Battery > Background limitations is not enabled. If the app is not yet optimized for Oreo API level it will break their background processing.
If all fails
If all fails you can turn doze mode completely off in Settings > Developer options. (If you don’t know how to enable developer options, Google should help.)