Android and foreground dose mode

I read a lot of questions about the dose mode, for example Android doze mode , Android N Doze mode - how to save the background file and processing? , Wakelock and doze modeand many others. But many answers have different opinions. I can not test it myself (the emulator does not support my processor, and the only test device is Android 5.1). I would like to know the following situation. I have an activity that controls a media player. On devices with Android 6.0 and above, it will not work as the expected cause of the dose regimen. According to many decisions, in order to prevent a dose regimen, he must start maintenance in a separate process in the foreground and control the media player from there. The question is: if I start the foreground with partial blocking of the track in a separate process that will do nothing but show a notification and leave the controls for the media player in my activity, should it prevent the dose regimen? Or maybe,are there other ways besides saving the screen from the window manager?

0
source share
1 answer

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.

+2
source

Source: https://habr.com/ru/post/1681870/


All Articles