According to this SO question and answer:
In this September 17th comment , Dianne Hackborn writes:
Applications that performed front-end services (with associated notification) were not dose-limited.
Using the foreground feature seems to prevent the killing of the Doze app.
Please note that some vendors (I know Samsung, but maybe others) create their own storage tools / batteries . Without even worrying about the dose. The same behavior is not guaranteed on these devices.
source
share