There is an old Android app which work background 2 service (Service).
It took to update the app with the possibility of sending data and logging while working is not a new DozeMode. Before you amend the current code I decided to check how everything will work now. To run the application, in the logs I see that both services are running (the basic meaning of the service to read the position of the device, the second service sends the data to the server). Turn off the screen with the command
adb shell dumpsys deviceidle step
translate the system to DozeMode:
Nikita:app NG$ adb shell dumpsys deviceidle step
Stepped to: ACTIVE
Nikita:app NG$ adb shell dumpsys deviceidle step
Stepped to: IDLE_PENDING
Nikita:app NG$ adb shell dumpsys deviceidle step
Stepped to: SENSING
Nikita:app NG$ adb shell dumpsys deviceidle step
Stepped to: LOCATING
Nikita:app NG$ adb shell dumpsys deviceidle step
Stepped to: IDLE
If I understand everything correctly - IDLE just the same mode in which according to the documentation all services, jobsheduler's, alarm managers, and other background components should be turned off. But this is not happening. Judging by the logs, the app works as intended and DozeMode either I'm doing something wrong.
Tell me, maybe are there any best practics for testing DozeMode and (late) rewriting with Services to a more modern, if there ways any action in the background (i.e. when you closed the app).
Android 6, BlackView BV6000S, Application is missing in the list permitted for non-optimal battery life (whitelist)
UPD: Nikita:app NG$ adb shell dumpsys deviceidle force-idle
Now forced in to idle mode
app works currently