virsir
virsir

Reputation: 15509

AlarmManager, alarm is not called when the phone is asleep

AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
long schedualed = getNextSchedualTime(context);
alarmManager.set(AlarmManager.RTC, schedualed, makeControlPendingIntent(context));

I know to set RTC_WAKEUP would run even if phone is sleep. But I want to know when the phone is asleep, would the RTC alarm which should be triggered in the sleeping time be delayed to when the phone wake up?

Upvotes: 1

Views: 732

Answers (1)

inazaruk
inazaruk

Reputation: 74790

From official documentation here:

Alarm time in System.currentTimeMillis() (wall clock time in UTC). This alarm does not wake the device up; if it goes off while the device is asleep, it will not be delivered until the next time the device wakes up.

So answer to your question: yes, it will be delayed and will not be dropped.

Upvotes: 3

Related Questions