On Wednesday, October 22, 2014 12:48:44 PM UTC+2, Jan Jongboom wrote:
> I have the following code and paste it in Console and then turn screen off 
> (no CPU locks active) and plug out the USB.
> 
> 
> 
> navigator.mozSetMessageHandler('alarm', function gotAlarm(message) {
> 
>   console.log(new Date(), 'alarm setmessagehandler', message.data);
> 
>   nextAlarm();
> 
> });
> 
> function nextAlarm() {
> 
>   var next = new Date(Date.now() + 3000);
> 
>   navigator.mozAlarms.add(next, 'ignoreTimezone', { data: 'yolo' });
> 
> }
> 
> nextAlarm();
> 
> 
> 
> After a while I turn the screen back on. When I run this in Clock app 
> everything is fine. I see a log message for every 3 seconds in the log.
> 
> 
> 
> When I do the same in the system app it stops logging anything when the 
> screen is off and USB is plugged out.
> 
> 
> 
> Is mozAlarms behavior different in System than in content apps or do I miss a 
> permission?

So the behavior actually seems to be that mozAlarms don't work when you create 
a new one from another one when the CPU is allowed to sleep or something. No 
clue wtf.
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to