Google

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 longer 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 that prevented foreground services from doing their intended job (see Solution for devs for workaround), but luckily this was later fixed in 7.0.

After Android 8, users or even the system (Adaptive battery in Android 9) can decide to prevent your app’s background processes from working and you may need to check the Background restrictions (or limits) option in your phone settings.

AOSP (Pixel, Nexus...)

Android P

There’s a special option in Settings > Apps > Your app > 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 your app not battery optimized to ensure it gets the freedom it needs to perform in the background.

For that:

  1. Go to Settings > Apps > Your app > Advanced > Battery > Battery optimization

  2. Change view to All apps

  3. Search for Pomodoro app

  4. Choose Not optimized

Android O

Make sure Settings > Apps > Your app > 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, a web search-engine should help.)