Trying to figure out the AlarmManager and sleep mode. And it turned out that I have little idea what this sleep mode is. I created two alarms: one with type ELAPSED_REALTIME and type ELAPSED_REALTIME_WAKEUP .

 manager.set(AlarmManager.ELAPSED_REALTIME, SystemClock.elapsedRealtime()+60000*5, pendingIntent); manager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime()+60000*5, pendingIntent); 

pendingIntent - just starts a service that writes to LogCat . Of course, I ran them separately and did not see the difference in them - both teams led to the same actions. Tell me what is the difference between these modes?

  • one
    And try to set the timer for 1 hour and leave for the night. Only not together, that would not interfere. (by the way, watch out for the programs, some people are preventing you from going to sleep). One of the timers will work properly, and the second will not. Sleep mode is a mode when the phone understands that it is not touched, there is no work and you can “sleep”). - KoVadim 2:21 pm
  • I understand that the sleep mode is trying to turn off the processor during inactivity. think 5 minutes was not enough to sleep? As I understand now, if the device is in sleep mode, then should it, in principle, ignore the alarm clock which has the label ELAPSED_REALTIME? - arg
  • 2
    I also think he should ignore. - KoVadim
  • Docks have not tried to read? int ELAPSED_REALTIME: Alarm time in SystemClock.elapsedRealtime () (time since boot, including sleep). int ELAPSED_REALTIME_WAKEUP: Alarm time in SystemClock.elapsedRealtime () (time since boot, including sleep), which goes off. developer.android.com/reference/android/app/AlarmManager.html - jimpanzer

0