title: How to test Doze Mode on Android?
body: <p>There is an old Android app which work background 2 service (Service).</p>
  
  <p>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</p>
  
  <pre><code>adb shell dumpsys deviceidle step
  </code></pre>
  
  <p>translate the system to DozeMode:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>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.</p>
  
  <p>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).</p>
  
  <p>Android 6, BlackView BV6000S, Application is missing in the list permitted for non-optimal battery life (whitelist)</p>
  
  <p>UPD: <code>Nikita:app NG$  adb shell dumpsys deviceidle force-idle</code>
  Now forced in to idle mode
  app works currently</p>