On Wed, Jun 16, 2010 at 8:43 PM, Mark Murphy <[email protected]>wrote:

> On Wed, Jun 16, 2010 at 9:23 PM, Robert Macaulay
> <[email protected]> wrote:
> > This works, I see my app run over and over. I see my app being killed,
> and
> > respawned via alarmReceiver. This all works great, but it randomly
> ceases.
> > No exceptions in the log. I luckily have the log showing the last running
> of
> > the service. The service runs, exits cleanly, and never runs again. I
> > originally thought it could be that my msTillNext was negative, but the
> docs
> > say that if the time is in the past, it will run immediately.
>
> You may want to test that anyway. For example, make sure that
> msTillNext is at least, say, 10, rather than smaller or negative. It
> wouldn't be the first time that the docs were wrong, and it shouldn't
> have any material impact on your actual app functionality.


I'll add that check. The only reason I didn't was the javadoc. It does seem
to happen when the phone is sleeping, and my code is woken up early. I'd
LOVE an alarm based on SystemClock.uptimeMillis(). It would make my logic
port from a Thread.sleep() easy.

>
> You could try adb shell dumpsys. Redirect the output to a file, then
> look for the line starting with:
>
> DUMP OF SERVICE alarm:
>
> You may see signs of your alarms in there. See if you can determine
> any patterns of what the dump looks like when the next alarm will
> succeed versus when it will fail.



What does the numbers in Alarm stats mean here? I'm assuming its the alarm
count totals, but not sure on the time or the flg parts.

>From a failed state.
Nothing under "  Elapsed realtime wakeup"
  Alarm Stats:
  51759ms running, 0 wakeups
    142 alarms: flg=0x4

------
restarted the alarms,  working state
under "  Elapsed realtime wakeup"
  ELAPSED #1: Alarm{454d4188 type 3 com.zomut.watchdoglite}
    type=3 when=156397679 repeatInterval=0 count=0
    operation=PendingIntent{454d4178: PendingIntentRecord{454d4100
com.zomut.watchdoglite broadcastIntent}}

Alarm Stats:
  com.zomut.watchdoglite
    51813ms running, 0 wakeups
    144 alarms: flg=0x4

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to