10

It is mentioned the following at the link hereafter (Pertaining to Doze mode in API level 23):

  • If you need to set alarms that fire while in Doze, use setAndAllowWhileIdle() or setExactAndAllowWhileIdle().
  • Alarms set with setAlarmClock() continue to fire normally — the system exits Doze shortly before those alarms fire.

What is the difference between setExactAndAllowWhileIdle and setAlarmClock, in regards to Doze mode?

Is setAlarmClock an exact Alarm?

https://developer.android.com/training/monitoring-device-state/doze-standby#testing_doze_and_app_standby

user229044
  • 232,980
  • 40
  • 330
  • 338
JF0001
  • 819
  • 7
  • 30

1 Answers1

-2

Yes setAlarmClock is same as setExactAndAllowWhileIdle. From Android Developers Documentation about setAlarmClock

Due to the nature of this kind of alarm, similar to setExactAndAllowWhileIdle(int, long, PendingIntent), these alarms will be allowed to trigger even if the system is in a low-power idle (a.k.a. doze) mode.

setAndAllowWhileIdle is same as set except it will get triggered when device in doze mode. If there are multiple setAndAllowWhileIdle alarms set in between a short interval, system might trigger all of them at once instead of triggering them one by one after few seconds/minutes. From documentation:

Under normal system operation, it will not dispatch these alarms more than about every minute (at which point every such pending alarm is dispatched); when in low-power idle modes this duration may be significantly longer, such as 15 minutes.

zeeshan090
  • 81
  • 5