I have an android app with the following Alarms setup: Alarm A is of type RTC_WAKEUP, uses the commonsguy wakeful pattern to start a service and repeats on an interval of 1 minute. Alarm B is of type RTC, starts a service and repeats on an interval of 10 seconds.
My questions are as follows:
Hopefully these are easy questions and thanks in advance!
Dom
Alarm A is of type RTC_WAKEUP, uses the commonsguy wakeful pattern to start a service and repeats on an interval of 1 minute.
Yuck.
Alarm B is of type RTC, starts a service and repeats on an interval of 10 seconds.
More yuck.
When the phone goes to sleep, for example it is left unused with screen off overnight, is it guaranteed alarm B will get triggered once every minute throughout the night because alarm A wakes up the device every minute? (Ignore the fact that alarm B might not execute fully to completion because it lacks a wakelock)
I would not count on it. I would define this behavior as somewhat indeterminate, due to the frequency of the events and the presumably short time window in which A runs.
Is alarm A likely to cause severe battery drain by waking up so regularly and causing an onslaught of other RTC alarms to be triggered?
I doubt it will be pleasant, though (as above) I don't know about the impact of the RTC alarms. The impact of the work you are doing may make things worse.
But I have a suspicion that the amount of drain is dependent on other apps installed and these apps taking advantage of alarm A regularly waking the device up. Is this correct?
It certainly won't help.
Any suggestions on better ways to test this?
Let it run for a day and see what the battery portion of Settings tells you.